Skip to content

python-math #44: refactor(math): PR 14b/14c — readable two-phase stats + blob-injection pins - #2673

Draft
jucor wants to merge 1 commit into
spr/edge/29a11a32from
spr/edge/acff8fbe
Draft

python-math #44: refactor(math): PR 14b/14c — readable two-phase stats + blob-injection pins#2673
jucor wants to merge 1 commit into
spr/edge/29a11a32from
spr/edge/acff8fbe

Conversation

@jucor

@jucor jucor commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What

GOAL_CUTOVER_READY.md Phase 3, the clarity refactor (Julien ruling 2026-07-27: land the clean code PRE-cutover; spec in HANDOFF_PR14_VECTORIZED_REFACTOR.md).

  • 14c: compute_group_comment_stats_df is split into the plumbing (_group_comment_vote_counts: mapping, totals, cross-product, the other_* columns) and the statistics recipe (_comment_stats_from_counts: pseudocount probabilities, proportion tests on raw counts, representativeness ratios, two-proportion tests, signed metrics, the "repful" pick) — the recipe now reads like the scalar chain it replaced. Pure code motion: identical operations in identical order, with bit-identity guarded by the certification battery (which replays 20 recorded dataset entries through the engine and compares against Clojure reference recordings).
  • 14b: TestBlobInjectionStats injects the CLOJURE result blob's group memberships (unfolded through the blob's own base clusters) plus the dataset votes into the PRODUCTION stats path, and compares every repness entry in the blob per (gid, tid): n-success / n-trials / p-success / p-test / repness / repness-test / repful-for. Green on the vw AND biodiversity datasets (repness-test is compared at 2e-6 relative tolerance because Clojure emits it rounded).

Also

The three sub-threshold cleanups from the collapse-review agent: CUTOVER_RUNBOOK.md drops the stale engine-mode env line; the greedy-carry threshold test drops its now-duplicate improved parametrize label; two module docstrings updated to collapse-era wording.

commit-id:acff8fbe


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 27, 2026
@jucor
jucor force-pushed the spr/edge/acff8fbe branch from 50ed96e to 705abf9 Compare July 27, 2026 17:20
@jucor
jucor force-pushed the spr/edge/29a11a32 branch from 5c3ce07 to 9156354 Compare July 27, 2026 17:20
@jucor
jucor force-pushed the spr/edge/29a11a32 branch from 9156354 to 9ed8298 Compare July 28, 2026 00:11
@jucor
jucor force-pushed the spr/edge/acff8fbe branch from 705abf9 to 5f86837 Compare July 28, 2026 00:11
@jucor jucor changed the title refactor(math): PR 14b/14c — readable two-phase stats + blob-injection pins python-math #44: refactor(math): PR 14b/14c — readable two-phase stats + blob-injection pins Jul 28, 2026
…s + blob-injection pins

## What

`GOAL_CUTOVER_READY.md` Phase 3, the clarity refactor (Julien ruling 2026-07-27: land the clean code PRE-cutover; spec in `HANDOFF_PR14_VECTORIZED_REFACTOR.md`).

- 14c: `compute_group_comment_stats_df` is split into the plumbing (`_group_comment_vote_counts`: mapping, totals, cross-product, the `other_*` columns) and the statistics recipe (`_comment_stats_from_counts`: pseudocount probabilities, proportion tests on raw counts, representativeness ratios, two-proportion tests, signed metrics, the "repful" pick) — the recipe now reads like the scalar chain it replaced. Pure code motion: identical operations in identical order, with bit-identity guarded by the certification battery (which replays 20 recorded dataset entries through the engine and compares against Clojure reference recordings).
- 14b: `TestBlobInjectionStats` injects the CLOJURE result blob's group memberships (unfolded through the blob's own base clusters) plus the dataset votes into the PRODUCTION stats path, and compares every repness entry in the blob per (gid, tid): n-success / n-trials / p-success / p-test / repness / repness-test / repful-for. Green on the `vw` AND `biodiversity` datasets (`repness-test` is compared at 2e-6 relative tolerance because Clojure emits it rounded).

## Also

The three sub-threshold cleanups from the collapse-review agent: `CUTOVER_RUNBOOK.md` drops the stale engine-mode env line; the greedy-carry threshold test drops its now-duplicate `improved` parametrize label; two module docstrings updated to collapse-era wording.

commit-id:acff8fbe
@jucor
jucor force-pushed the spr/edge/29a11a32 branch from 9ed8298 to f0bb734 Compare July 28, 2026 01:10
@jucor
jucor force-pushed the spr/edge/acff8fbe branch from 5f86837 to b00638d Compare July 28, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant