Skip to content

Cascade confirmation Stage 0 (#35 B1): N, both T and C dropped - #293

Merged
jonfroehlich merged 6 commits into
mainfrom
analysis/open-weight-cascade-confirm-s0
Nov 25, 2026
Merged

jonfroehlich merged 6 commits into
mainfrom
analysis/open-weight-cascade-confirm-s0

Conversation

@jonfroehlich

@jonfroehlich jonfroehlich commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Stage 0 of the open-weight cascade confirmation plan (#35, option B1). CPU only, committed inputs only, about 3 s, no spend.

Base is main. The branch was first stacked on #289, which merged on 2026-11-17; current main is merged in.

Result: N. Both T and C are dropped, and the work stops here.

rule reading verdict
1, drop T rig key test does not pass; pooled held-out T − N = −0.022 [−0.038, −0.003] drop T
2, drop C pooled held-out C − max(N, T) = +0.027 [+0.007, +0.043] (folds' counts summed), wins 2 of 4 splits, bar +0.03 drop C
3, one-instance flag worst leave-one-out +0.079; top 5 panos carry 0.41 of net promoted ramps not flagged

C is close but under the +0.03 bar, and all of its gain comes from laurens_mapillary (+0.091) and bayonne (+0.051). This is a screen on splits the cascade study already inspected, so it can end the work but confirms nothing. Per the plan, B1 closes at no cost; Stage 1 (Lyon) and Stage 2 (Kaysville) are not run.

Open, Jon's call: which reading of "pooled" Rule 2 uses

The plan says "pooled held-out C minus max(N, T)" and does not define pooled. The stop rests on summing the four folds' counts into one F1, as cascade_argon_35 pools. Read as the mean of the four per-split deltas, C − max(N, T) is +0.0313 [+0.0088, +0.0465], 2 wins: C survives Rule 2, the outcome is C only, and the plan would go on to Stage 1 (Lyon). The verdict above is unchanged; the doc's section "Rule 2 rests on one reading of "pooled"" gives both readings, plus:

  • the count margin: summed C needs 768 TP instead of 762 (6 more of 1,117 GT ramps), or 216 FP instead of 225, to reach +0.03;
  • 35.6% of the 2,000 resamples have summed-count C − max(N, T) at or above +0.03 (51.9% for the per-split mean);
  • on the training splits the chosen and second-best candidates are within 0.0023 F1 in every fold, and on the held-out split the second-best scores higher in all four; with every fold's second-best, summed-count C − max(N, T) is +0.0311;
  • restricted to one arm: +0.0302 (y11l_pano), +0.0200 (y11x_pano_h200), +0.0138 (y26_pano).

All of these are written to stage0.json (pooling_readings, selection_sensitivity) by the committed script and pinned by --check.

Full write-up: docs/cascade_confirm_35.md, with the plan's Stage 0 section and the run's Lyon/Kaysville instruction in its appendices. Reproduce: python scripts/analysis/cascade_confirm_35.py --check (registered in check_all.py; it now byte-compares stage0.json and inputs.json); figure from cascade_confirm_35_figures.py.

🤖 Generated with Claude Code — Opus 5.5, claude-opus-5-5; review-1 fixes by claude-opus-5-5

CPU screen on the four GoPro Max splits (laurens_mapillary, bayonne,
budapest_district5, morgantown), rig mask applied to every policy.
Leave-one-split-out with selection repeated in 2,000 stratified pano
resamples:
- Rule 1 drop T: pooled T - N -0.022 [-0.038, -0.003]; rig key test
  does not pass (contributor tie at 0.000; ecartip not evaluated,
  Lyon withheld).
- Rule 2 drop C: pooled C - max(N, T) +0.027 [+0.007, +0.043], 2 of 4
  splits won, below the +0.03 bar.
- Rule 3 not flagged: worst leave-one-sequence-out gain +0.079, top-5
  panos carry 0.41 of net promoted ramps.
- Outcome N.

Both reproduction checks (cascade_cost_35, cascade_argon_35) report 0
differences. Lyon and Kaysville are not read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonfroehlich
jonfroehlich changed the base branch from cascade-argon-b0 to main November 17, 2026 14:01

@jonfroehlich jonfroehlich left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review 1 of PR #293 at head 1ff8b217

Comment only. I re-derived the numbers, ran the checks and tests at the head and on a local trial merge of origin/main (2a52673c), and mutated the script against its tests. Everything was run with D:\Git\RampNet\.venv\Scripts\python.exe (Python 3.12.10, Windows), with PYTHONPATH set to my worktree so rampnet was imported from the PR head.

Summary. Every number in the PR body and the doc reproduces, the code matches the plan's Stage 0 rules, nothing is fit on the split it is scored on, and N follows from the rules as coded. One thing blocks merge (CI is red, finding 1). One thing Jon should see before accepting the stop: the Rule 2 verdict depends on how "pooled" is read, and the doc gives only the reading under which C is dropped (finding 2).

What I confirmed

  • Numbers. An independent leave-one-split-out loop over the per-pano counts (plain Python, not the script's loso) gives the same four folds and the same pooled counts: N 689 / 170 / 428, T 702 / 259 / 415, C 762 / 225 / 355 of 1,117. Pooled T − N = −0.0217, C − max(N, T) = +0.0270, wins 2 of 4; per split +0.0908, +0.0506, −0.0082, −0.0078. With seed 0 the intervals come back as [−0.0384, −0.0035] and [+0.0070, +0.0426]. Laurens: gain +0.0908, net promoted 29, top five 12 of 29 = 0.414, worst leave-one-sequence-out +0.0792 (z0rwf2KqY6IS5XELmdtpyV), range up to +0.101. The in-sample table, the rig key table, the mask counts (33 / 8 / 9 / 0) and the unmasked pooled N of 0.6963 all match stage0.json.
  • Rules as coded against the plan (section 3). Bars +0.03, two wins, +0.02 and "over half" for five panoramas match. The grid is the plan's 144 candidates and t* from 0.10 to 0.55. Selection of t* and the C candidate uses the other three splits only, in the point estimate and in every resample. The mask constant and its strict inequality match the labeler's detectors.on_camera_rig.
  • No ties. Each fold's best t* and best candidate are unique on the training splits, so the tie-break rule (Amendment 5) does not affect any number.
  • Seed and bootstrap unit. The decision on C rests on the point estimate, which does not depend on the seed. Over seeds 1 to 20 the lower bound of C − max(N, T) stays in [+0.0059, +0.0076] and the upper bound of T − N in [−0.0049, −0.0027]. Resampling sequences instead of panoramas (seeds 0 to 2) gives lower bounds of +0.0059 to +0.0069 for C and upper bounds of −0.0019 to −0.0038 for T. No verdict changes.
  • t* grid and mask choices. Restricting t* to 0.10–0.30, or to steps of 0.05, leaves C − max(N, T) at +0.0270. With no mask anywhere it is +0.0270; with the mask on T and C but not on N it is +0.0280. All below +0.03.
  • Checks at the head. cascade_confirm_35.py --check: same, exit 0. tests/test_cascade_confirm_35.py: 10 passed. check_all.py --ci: every entry PASS (including cascade_cost_35, 375 s, and cascade_confirm_35, 2.6 s), exit 0. Running the script with --out into a scratch directory reproduces stage0.json and inputs.json byte for byte, all 24 input hashes match the files on disk, and the figure script reproduces heldout.png byte for byte.
  • Trial merge of origin/main (local, not pushed). Merges clean. cascade_confirm_35.py --check passes and the PR's 10 tests pass. tests/test_check_all.py passes. check_all.py --ci on the merged tree: 42 PASS, 0 FAIL, exit 0 (cascade_cost_35 321 s, cascade_confirm_35 2.1 s). cascade_argon_35.py --check on the merged tree: 0 differ, exit 0. So both of the doc's Step 1 commands report 0 differences. The only failure on the merged tree is finding 1.

Findings

1. Blocking for merge: CI is red, docs/cascade_confirm_35.md has no row in docs/README.md.
Reproduce: python -m pytest -q tests/test_docs_index.py at 1ff8b217 → test_every_document_in_docs_has_a_row fails naming cascade_confirm_35.md. Same failure on the trial merge; the test passes on origin/main. It is the only failure in both CI jobs (1 failed, 3732 passed). Fix: add the row (the "Model comparison & cost" group holds the other two cascade docs).

My full local run at the head had two more failures, tests/test_mix_training_dirs.py::test_mix_has_every_sparse_pano_and_a_seeded_gsv_sample and tests/test_stage1_bearing_residual.py::test_great_circle_matches_the_geodesic_used_by_stage_1. Both fail the same way on origin/main with the same interpreter and both pass in CI, so they are not from this PR.

2. Should-fix, and Jon's call: the Rule 2 verdict depends on what "pooled" means, and the doc gives one reading.
The plan says "pooled held-out C minus max(N, T)" and does not define pooled. The script sums the four folds' counts and takes one F1 (Amendment 3), which gives +0.0270 and drops C. The other plain reading, the mean of the four held-out split results, gives:

reading C − max(N, T) 95% interval (seed 0) Rule 2
summed counts (the PR) +0.0270 [+0.0070, +0.0426] drop C
mean of the four per-split deltas +0.0313 [+0.0088, +0.0465] C survives
mean F1 of C minus the larger of mean F1 of N and T +0.0326 not computed C survives on the point estimate

Reproduce from the doc's own Step 3 table: (0.0908 + 0.0506 − 0.0082 − 0.0078) / 4 = +0.0314. The interval is from deltas(boot)["split_C_minus_maxNT"].mean(axis=1) with the script's seed-0 weights. Under the second reading C clears +0.03 with a lower bound above 0 and two wins, the outcome is "C only", and the plan would go on to Stage 1.

Summed counts is how cascade_argon_35 pools, so the PR's reading is defensible. But the doc's Amendments section says it gives both readings where they disagree, and here they disagree on the verdict. The doc should state the second reading next to the first and say which one the stop rests on.

Related facts that belong in the same paragraph, all from the committed counts:

  • The margin is small in counts. Pooled C would need 768 TP instead of 762 at the same 225 FP (6 ramps of 1,117), or 216 FP instead of 225 at the same TP, to reach +0.03.
  • In 36% of the 2,000 resamples the summed-count C − max(N, T) is at or above +0.03 (52% for the per-split mean).
  • The choice of candidate is close and it matters. On the training splits the best and second-best candidates are within 0.0023 F1 of each other in every fold (0.0023, 0.0005, 0.0007, 0.0017). On the held-out split the chosen candidate scores below the second-best in all four folds: laurens 0.7558 against 0.7615, bayonne 0.6506 against 0.6543, budapest 0.6667 against 0.6689, morgantown 0.8403 against 0.8453. With the same procedure restricted to one arm, summed-count C − max(N, T) is +0.0302 for y11l_pano, +0.0200 for y11x_pano_h200 and +0.0138 for y26_pano. The doc's "selections are unstable" sentence is true; these numbers say what the instability is worth against the bar.

None of this shows C works. The gain is still two splits, the screen is on inspected data, and the Caveats already note that the bar is Jon's to revisit. The point is that "N, and the work stops" is the result under one of two readings of an undefined word, by 0.003, and the doc currently reads as if the rule left no room.

3. Should-fix: the plan the doc cites is not in the repo or on the issue.
The doc and the script cite open-weight-cascade-confirm-2026-11-15.md, its review, "the common rules for this run" and "the instruction for this run" (which is the stated reason Lyon is withheld from step 4). git grep open-weight-cascade-confirm finds only this PR's three files, and issue #35 has no comment that mentions the plan, option B1 or Stage 0. A reader cannot check that the bars and the grid were fixed before the run, read the review whose numbers the doc quotes (−0.008, 0.769), or see why step 4 departs from the plan. The rules themselves are restated in the doc, so the result is reproducible; the provenance of the rules is not. Fix: put the plan's Stage 0 section (steps and rules) and the Lyon instruction somewhere a clone can reach, in the doc or as a comment on #35, with the date, and record the run on #35.

4. Should-fix: docs/replication.md has no entry for the new check.
The "Running every check" table lists every other check_all entry with its command and what it proves, and the lists under it name the entries that pin analysis_out/op_cache/, benchmark/model_detections/ and benchmark/<split>/verdicts.json. cascade_confirm_35 pins all three and appears in none (git grep cascade_confirm_35 -- docs/replication.md is empty). No test enforces this, so CI will not catch it.

5. Should-fix: the rules are tested only through the byte-compare, so several wrong versions of them pass.
Rules 1 to 4 are computed inline in run(), and the only test that reaches them is test_stage0_regenerates_byte_for_byte. A change that would give a wrong verdict on other data but leaves this output unchanged passes all 10 tests. Each line below is a one-line edit to scripts/analysis/cascade_confirm_35.py, then python -m pytest -q tests/test_cascade_confirm_35.py → 10 passed:

  • C_MIN_GAIN = 0.03 → 0.028 or 0.05 (the bar itself is not written to stage0.json and no test reads it; 0.02 is caught because the verdict flips)
  • C_MIN_WINS = 2 → 1
  • ONE_INSTANCE_GAIN = 0.02 → 0.07
  • share > 0.5 → share > 0.42
  • Rule 2 without or c_lb <= 0; Rule 2 without or wins < C_MIN_WINS
  • Rule 1 without or t_lb <= 0
  • Rule 2 reading pooled["C_minus_N"] in place of pooled["C_minus_maxNT"]
  • the outcome labels "T only" and "C only" swapped
  • C_beats_maxNT with >= 0 in place of > 0

Also, test_loso_selects_on_the_other_splits_only does not test what its name says: with tr = [s for s in range(S)] (the held-out split included in selection) it still passes, because its synthetic data picks index 0 either way. That mutation is caught only by the byte-compare.

Killed by the tests (17 of 28 mutations; the 11 above survive): the bar at 0.02, three wins required, held-out split used alone for selection, C selected on all four splits, pooling changed, max(N, T) replaced by N in deltas, seed, resample count, mask removed, rig-key sides and primary reading, the leave-one-out gain definition, a split removed, and the lower bound replaced by the upper.

Fix: move the four rules into a pure function of the pooled numbers and test each branch on hand-made inputs; write the bars into stage0.json; give the leave-one-split-out test data where including the held-out split changes the pick.

6. Nit: Rule 1's rig-key branch cannot pass. rig_key() sets "passes": False in both readings unconditionally, so drop_T is true whatever the shares are. That is correct for this run (Lyon is withheld, and the doc says so), and T is also dropped on the interval alone. But the script cannot return "T survives" if someone later adds ecartip; say so in the docstring or compute it.

7. Nit: inputs.json is written but never compared. --check and the tests skip it (the stated reason is core.autocrlf=true checkouts). It matches today (24 of 24). A check that normalises line endings before hashing, or a test that skips when a \r is found, would keep it from going stale.

8. Nit: stale text. The doc's header says "Base: branch cascade-argon-b0 at b3868c8e" and the PR body says "Stacked on #289 ... Retarget to main after #289 merges". #289 merged on 2026-11-17 and the base is already main. The head also predates current main; merge main in and let CI run on that head before merging.

Not verified

  • The ecartip half of the rig key test. I did not read Lyon or Kaysville either.
  • cascade_argon_35.py --check at the PR head itself. I ran it on the trial merge only (0 differ); cascade_cost_35.py --check passed on both.
  • The full test suite on the trial merge. I ran the PR's tests, test_docs_index.py, test_check_all.py and the two tests that failed at the head.
  • Python 3.10. I ran 3.12 only; CI's 3.10 job shows the same single failure.
  • The interval for the "mean F1" row in finding 2, and any reading that changes the candidate grid.

🤖 Generated with Claude Code — Fable 5.2, claude-fable-5-2

jonfroehlich and others added 3 commits November 24, 2026 19:02
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
 review 1)

Findings 2, 5, 6 and 7 of review 1.

- The four rules are pure functions (drop_T, drop_C, one_instance, outcome,
  won), combined by rules_from_deltas; the bars are constants written into
  stage0.json as `bars`. Tests cover every branch on hand-made inputs, and
  the leave-one-split-out test now has data where including the held-out
  split changes the pick. All 11 surviving mutants from the review now fail
  without the byte-compare.
- stage0.json gains `pooling_readings` (summed counts, mean of the per-split
  deltas, mean F1; intervals, share of resamples at or above +0.03, count
  margin) and `selection_sensitivity` (second-best candidate per fold, one
  arm at a time). Used by no rule; the verdict, bars and every existing
  field are unchanged (238 lines added, 0 removed).
- rig_key_passes(): the key cannot pass without ecartip's share.
- Input hashes read CRLF as LF, and --check now byte-compares inputs.json
  too (all 24 hashes unchanged). check_all pins inputs.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ws (PR #293 review 1)

Findings 1, 2, 3, 4 and 8 of review 1.

- docs/README.md: row for cascade_confirm_35.md (fixes test_docs_index).
- docs/cascade_confirm_35.md: new section setting out both readings of
  "pooled" in Rule 2. The stop rests on summed counts (+0.0270); the mean of
  the per-split deltas gives +0.0313 [+0.0088, +0.0465] and "C only". Which
  governs is open, Jon's call; the verdict is unchanged. Amendment 3 updated.
  Appendix A copies the plan's Stage 0 section (2026-11-15) verbatim;
  Appendix B restates the run instruction that withholds Lyon and Kaysville.
  Base line now says main; replication notes that --check compares inputs.json.
- docs/replication.md: cascade_confirm_35 row and cross-pin entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonfroehlich

Copy link
Copy Markdown
Member Author

Answers to review 1

Three commits: 9ba46059 merges origin/main (2a52673c), 8ad05d56 holds the script, test and output changes, and b62d1da8 the docs. I reproduced each finding at 1ff8b217 before changing anything. No verdict, bar or point estimate changed: the regenerated stage0.json differs from the old one by additions only (238 lines added, 0 removed; the new top-level keys are bars, pooling_readings and selection_sensitivity). inputs.json and heldout.png regenerate byte for byte.

1. Fixed (b62d1da8). Reproduced: tests/test_docs_index.py::test_every_document_in_docs_has_a_row failed on cascade_confirm_35.md. Added the row to "Model comparison & cost", after the two other cascade docs. Its hook states the open reading from finding 2.

2. Doc and output fixed (8ad05d56, b62d1da8); the choice is left for Jon. The verdict, the bar and the reading the stop rests on are unchanged. The script now writes the readings into stage0.json (pooling_readings), the doc has a section "Rule 2 rests on one reading of "pooled" (open, Jon's call)", and the PR body marks the choice the same way. I re-derived every number in the script. All agree with the review except one rounding: the laurens training gap between the chosen and second-best candidates is 0.00224, which I write as 0.0022 (the review has 0.0023).

reading of "pooled" C − max(N, T) 95% interval (seed 0) resamples ≥ +0.03 Rule 2 outcome
summed counts (as coded) +0.0270 [+0.0070, +0.0426] 35.6% drop C N
mean of the four per-split deltas +0.0313 [+0.0088, +0.0465] 51.9% C survives C only
mean F1 of C minus the larger of mean F1 of N and T +0.0326 [+0.0108, +0.0488] 58.5% C survives C only

The third interval is new; the review did not compute it. Also in stage0.json and the doc: the count margin (768 TP at the same 225 FP, or 216 FP at the same 762 TP); per fold, the chosen and second-best candidates with training and held-out F1 (the second-best is higher on the held-out split in all four folds); summed-count C − max(N, T) with every fold's second-best, +0.0311 (not in the review); and the one-arm runs, +0.0302 / +0.0200 / +0.0138 for y11l_pano / y11x_pano_h200 / y26_pano. Every reading wins 2 of 4 splits. Amendment 3 no longer says the alternative readings agree. It now says the per-split mean reading disagrees, and points to the new section.

3. Fixed (b62d1da8, plus a comment on #35). docs/cascade_confirm_35.md now has Appendix A, section 3 of the plan (Stage 0 steps and rules) copied verbatim, with the plan's date and evidence that it predates the result: the plan file was last modified at 08:48 Pacific on 2026-11-15, and 1ff8b217 was committed at 11:57. Appendix B restates the run instruction that withholds Lyon and Kaysville, and the common rules on literal readings. Their original wording is not on disk anywhere I could find, so the appendix says it is a restatement. Nothing from the plan's other sections is copied. The #35 comment records the plan, option B1, this run, the result and the open reading: #35 (comment)

4. Fixed (b62d1da8). docs/replication.md now has a cascade_confirm_35 row in "What each entry proves" (2.3 s, from a standalone --check on 2026-11-24), and the entry is named in the cross-pin lists for analysis_out/op_cache/, benchmark/model_detections/ and benchmark/<split>/verdicts.json. Those lists were already missing cascade_argon_35 and the #276 local-cache entries before this PR. I did not touch them, since they are outside this PR.

5. Fixed (8ad05d56). The rules are now pure functions: drop_T, drop_C, one_instance, outcome and won (a strict gain), combined by rules_from_deltas(dp, db, ...), which takes the point and bootstrap deltas. per_split_mean_reading and mean_f1_reading reuse them. The bars are module constants (adding T_MIN_LOWER, C_MIN_LOWER, TOP_SHARE_MAX), and bars() writes them into stage0.json. I wrote the tests before the code. They are: test_bars_are_the_plans (literals), a branch test for each rule including the exact bar values, test_rules_read_max_N_T_not_N (hand-made deltas where C − N clears every bar and C − max(N, T) does not), and an outcome test through rules_from_deltas. test_loso_selects_on_the_other_splits_only has new data: with the held-out split also in training the picks change from [0, 1, 1] to [1, 1, 1], and N is now poor enough that max(N, T) differs from N, pooled and per split. Mutation run against the new code, with your 11 survivors mapped onto it: every one now fails, with the byte-compare test deselected. The same holds for "selection sees the held-out split too", which before was caught only by the byte-compare.

bar 0.03 -> 0.028                      test_bars_are_the_plans, test_rule2_drop_C_branches
bar 0.03 -> 0.05                       test_bars_are_the_plans, test_rule2_drop_C_branches, test_per_split_mean_reading
min wins 2 -> 1                        test_bars_are_the_plans, test_rule2_drop_C_branches
one-instance gain 0.02 -> 0.07         test_bars_are_the_plans, test_rule3_one_instance_branches
top5 share > 0.5 -> > 0.42 (constant)  test_bars_are_the_plans, test_rule3_one_instance_branches
top5 share > 0.5 -> > 0.42 (inline)    test_rule3_one_instance_branches
rule 2 without the lower-bound term    test_rule2_drop_C_branches
rule 2 without the wins term           test_rule2_drop_C_branches
rule 1 without the interval term       test_rule1_drop_T_branches, test_rules_from_deltas_each_outcome
rule 2 reads C - N                     test_rules_read_max_N_T_not_N
outcome labels swapped                 test_rule4_outcome_labels (+3 more)
wins counted with >= 0                 test_won_is_strict, test_rules_read_max_N_T_not_N
selection sees the held-out split      test_loso_selects_on_the_other_splits_only

Your 17 killed mutants are all still killed with the full file. Ten of them now also fail without the byte-compare, including Rule 1 reading the upper bound (a hand-made T − N interval that straddles 0) and both "max(N, T) replaced by N" mutants (the leave-one-split-out data now has N below T). Seven are still caught only by the byte-compare: seed, resample count, mask removed, budapest off the rig key's other side, the rig key's primary reading, the leave-one-out gain defined against N, and worst replaced by best leave-one-out. They change the data path, where there is no hand-made answer to test against, so I left them to the byte-compare.

6. Fixed (8ad05d56). New rig_key_passes(laurens_side, other_side, ecartip=None): it returns False when ecartip is not supplied, and otherwise requires one cut with Laurens and ecartip together on one side. rig_key() calls it, so the output is unchanged (passes: false). The module docstring and the function say T can survive Rule 1 only once ecartip's share is supplied. Tested, including ecartip on the wrong side and a tie.

7. Fixed (8ad05d56). _sha now hashes each input with CRLF read as LF, and --check byte-compares inputs.json as well as stage0.json (check_all pins it too). No input contains a CR in the repository, so all 24 hashes are unchanged, and a core.autocrlf=true checkout gives the same values. Added test_inputs_json_is_current and test_sha_reads_crlf_as_lf.

8. Fixed (9ba46059, b62d1da8). Merged origin/main (clean). The doc's header now says the base is main and that #289 merged on 2026-11-17 (UTC), and the PR body no longer says it is stacked.

Checks at b62d1da8 (Windows, Python 3.12.10): cascade_confirm_35.py --check same / same, exit 0. pytest -q tests/test_cascade_confirm_35.py tests/test_docs_index.py tests/test_check_all.py: 164 passed. check_all.py --ci: 42 passed, 0 failed, 12 skipped (local-cache), cascade_confirm_35 PASS in 2.3 s, exit 0. CI on the new head: all three jobs green (checks, pytest (3.10), pytest (3.12)), run https://github.com/ProjectSidewalk/RampNet/actions/runs/45540749495.

Left for Jon: which reading of "pooled" Rule 2 uses (finding 2). Nothing else is open.

🤖 Generated with Claude Code — Opus 5.5, claude-opus-5-5

@jonfroehlich jonfroehlich left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review 2 of PR #293: range 1ff8b217..b62d1da8, head b62d1da8

Comment only. Same reviewer as review 1. I reviewed 8ad05d56 (script, tests, outputs) and b62d1da8 (docs), not the merge of main (9ba46059). I checked the fixer's answer comment, the #35 record and the new PR body as claims. Everything ran with D:\Git\RampNet\.venv\Scripts\python.exe (Python 3.12.10, Windows), PYTHONPATH set to my worktree at b62d1da8.

Summary. All eight findings from review 1 are closed, and the fixes broke nothing I could find. No verdict, bar or number from review 1 changed. Nothing blocks merge. The one thing that still stands is the one the fixer left for Jon on purpose: which reading of "pooled" Rule 2 uses. Below that are four nits about test coverage and one about the CRLF note; none needs another round.

Still open (Jon's call, not a defect)

Rule 2 drops C at +0.0270 under summed counts and keeps it at +0.0313 under the mean of the four per-split deltas (+0.0326 under mean F1). The PR's verdict is N; under the other reading it is "C only" and the plan goes on to Stage 1 (Lyon). The doc, the PR body, the docs/README.md row and the #35 comment all now say this and all say the choice is open. I read the new doc section for balance: it gives both readings in one table with the same resamples, says the stop rests on summed counts, says none of the sensitivity numbers shows that C works, and does not argue for either reading. The title and the first heading still say "N", which is accurate for the rule as coded, and the next paragraph says what that rests on.

The eight findings

  1. docs/README.md row: closed. Row added in "Model comparison & cost". tests/test_docs_index.py passes; CI on b62d1da8 is green on all three jobs (run 45540749495).
  2. Second reading of "pooled": closed as a documentation finding. See above. Numbers verified below.
  3. Plan not reachable: closed. Appendix A is section 3 of the plan, verbatim: I stripped the quote markers and compared it with the local plan file, 2,110 characters, identical. Nothing from the plan's other sections is in the doc, the PR body or the #35 comment. The dates hold: the plan file's modification time is 2026-11-15 08:48:07 −0800 and 1ff8b217 was committed at 11:57:50 −0800. Appendix B says in its own text that it is a restatement and that the original wording is not in the repository, which is the honest way to put it. The #35 comment exists and records the plan, the run, the result and the open reading.
  4. docs/replication.md: closed. The row is in the table and the entry is in the three pin lists.
  5. Rules tested only through the byte-compare: closed. See the mutation results below.
  6. Rig-key branch hardcoded: closed. rig_key_passes returns False without ecartip and is tested with ecartip on each side and at a tie. Output unchanged.
  7. inputs.json never compared: closed. --check prints same for both files and exits 0; check_all pins both; test_inputs_json_is_current covers it.
  8. Stale text: closed. The doc header and PR body say the base is main; main (2a52673c) is merged in.

What I verified

  • (a) Outputs. git diff --numstat 1ff8b217 b62d1da8 on stage0.json: 238 added, 0 removed. Parsed: the only new top-level keys are bars, pooling_readings, selection_sensitivity, and every key that existed at 1ff8b217 has an equal value. inputs.json and heldout.png are the same blobs as at 1ff8b217.
  • (b) New numbers. I recomputed the three readings with a plain per-resample loop that does not call the script's loso, deltas or the new reading functions (same seed-0 weights): summed [+0.006986, +0.042621], 35.55% at or above +0.03; per-split mean [+0.008827, +0.046535], 51.85%; mean F1 [+0.010753, +0.048785], 58.50%. All match stage0.json to the digit, and the doc's 35.6% / 51.9% / 58.5%. Second-best candidate in every fold, summed counts: +0.031108, matches +0.0311. Training gaps 0.002240, 0.000536, 0.000674, 0.001696. The fixer is right about laurens: it is 0.00224, and my 0.0023 came from subtracting rounded values. The doc's "within 0.0023 in every fold" is still true. Count margin (768 TP, or 216 FP) and the one-arm numbers (+0.0302 / +0.0200 / +0.0138; per-split means +0.0346 / +0.0233 / +0.0171) match.
  • (c) Refactor. drop_T, drop_C, one_instance, outcome, won, rules_from_deltas and rig_key_passes reproduce every pre-existing key of stage0.json exactly (item a), and I read the diff line by line: the conditions and their operands are the ones that were inline. The C-against-N win count changed from comparing the folds' F1 values to split_C_minus_N > 0; these are the same quantity.
  • (d) _sha. It hashes the file with \r\n replaced by \n. I probed it on scratch files: a CRLF copy and a mixed-ending copy hash the same as the LF file; a lone \r and a changed value do not. The inputs are JSON and JSONL, where a raw CR or LF cannot occur inside a string, so the only differences this hides are line endings, which do not change what the script reads. No committed input contains a CR (checked all 24), so each value is also the plain sha256, as the doc says. The pin is not weakened in any way that matters. _sha: hash only the first 64 KiB and _sha: strip spaces too are both caught by test_inputs_json_is_current.
  • (e), (f), (g). Covered under findings 3, "Still open", and findings 1 and 4. I searched the doc, the PR body, the #35 comment and the answer comment for licensing or terms language and for session links: none.
  • Checks at b62d1da8. cascade_confirm_35.py --check: same twice, exit 0. pytest -q tests/test_cascade_confirm_35.py tests/test_docs_index.py tests/test_check_all.py: 164 passed. check_all.py --ci: 42 PASS, 0 FAIL, 12 SKIP (local-cache or slow), exit 0; cascade_cost_35 PASS in 328 s, cascade_confirm_35 PASS in 2.1 s. There was no failure to compare against origin/main.

Mutation results (52 mutants of cascade_confirm_35.py, each run against tests/test_cascade_confirm_35.py with and without test_stage0_regenerates_byte_for_byte)

  • 48 of 52 are caught by the full file; 32 are caught without the byte-compare. Every one of my 11 survivors from review 1 is now caught without it, as the fixer says, and so are the three leave-one-split-out leaks (held-out split in selection, C selected on all splits, t* selected on all splits).
  • Caught only by the byte-compare (16). The seven the fixer lists (seed, resample count, mask removed, budapest off the rig key's other side, the rig key's primary reading, the leave-one-out gain against N, worst replaced by best). Plus nine the answer does not mention:
    • in rules_from_deltas: Rule 2's lower bound read from the C − N interval, and Rule 2's lower bound replaced by the upper bound. These are rule logic, not data path. The hand-made _deltas gives every series the same spread and never puts the C interval across 0, so the tests cannot tell which bound or which series is read. Rule 1's bound is covered; Rule 2's is not.
    • in the new readings: per-split-mean interval taken from the pooled resamples; mean-F1 with max(N, T) replaced by N; mean-F1 averaged the wrong way; the resample share computed against a different bar.
    • in selection_sensitivity: third-best taken as the runner-up; the one-arm run using all candidates.
    • split_C_minus_N computed as C − T.
  • Pass the full file (4).
    • one_instance: worst_loo_gain < ONE_INSTANCE_GAIN → <=. The exact +0.02 boundary is not tested (the others' boundaries are).
    • per_split_mean_reading: outcome(drop_t, dc) → outcome(True, dc). The test only passes drop_t=True.
    • runner_up_pooled_C_minus_maxNT against N alone. Pooled T is below pooled N in the data, so the value does not change.
    • In main, ok = ok and same → ok = ok or same: --check then exits 0 when one of the two files differs. No test calls main. test_inputs_json_is_current and the byte-compare test cover the same files directly, so the gap is in the CLI and the check_all entry only.

Nits (none blocking)

  1. Rule 2's interval bound is tested only by the byte-compare. Reproduce: in rules_from_deltas change ci95(db["C_minus_maxNT"])[0] to [1], then pytest -q tests/test_cascade_confirm_35.py --deselect tests/test_cascade_confirm_35.py::test_stage0_regenerates_byte_for_byte → all pass. One more hand-made case with a C interval that straddles 0 (as the T case already has) closes it.
  2. The four full-file survivors above. Each is one assertion.
  3. The answer's "seven are still caught only by the byte-compare" undercounts. By my run it is 16 of 52, nine of them in code this range added or moved. Most are context numbers that no rule reads, so the practical risk is small, but the count in the answer should not be quoted.
  4. CRLF checkouts still fail --check. The hashes are now stable under core.autocrlf=true, but stage0.json and inputs.json are themselves compared as bytes. Reproduce: make CRLF copies of the two files in a scratch directory and run cascade_confirm_35.py --check --out <that directory> → DIFF twice, exit 1. This is how every --check in the repo behaves, so it is not new; the doc's sentence about core.autocrlf=true is true of the hash values and should not be read as "the check passes there".
  5. docs/README.md lists the doc as final while its own text says the reading is open. Fine if "final" means the run is done; worth a word if Jon picks the other reading.

Not verified

  • The full test suite locally at b62d1da8. I ran the three touched test files and relied on CI for the rest (both pytest jobs green on this head).
  • cascade_argon_35.py --check at this head (slow entry, --all only). It passed on my trial merge in review 1 and nothing in this range touches its inputs.
  • A real core.autocrlf=true clone. Nit 4 was reproduced with CRLF copies of the two output files, not with a fresh checkout.
  • Python 3.10 locally (CI's 3.10 job is green).
  • The ecartip half of the rig key test. I did not read Lyon or Kaysville.
  • That the Appendix B restatement matches the original run instruction. Its wording is not on disk; the appendix says so.

🤖 Generated with Claude Code — Fable 5.2, claude-fable-5-2

Tests only, plus one doc paragraph; the script and its outputs are unchanged.

- Rule 2 with a C - max(N, T) interval that straddles 0 while C - N does not
  (catches the upper-bound and C - N-interval mutants).
- Rule 3 at exactly +0.02; per_split_mean_reading with drop_t False and a
  pooled interval that crosses 0; mean_f1_reading on hand-made F1s;
  selection_sensitivity on 144 hand-made candidates with T above N;
  split_C_minus_N; main --check exits 1 when one of two files differs.
- On review 2's 52 mutants: 52 fail the full file, 44 without the
  byte-compare (was 32), 0 pass the whole file (was 4).
- docs/cascade_confirm_35.md: the CRLF note covers the hash values only;
  --check still reports DIFF in a core.autocrlf=true checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonfroehlich

Copy link
Copy Markdown
Member Author

Answers to review 2

One commit, 78592b52: tests and one doc paragraph. scripts/analysis/cascade_confirm_35.py, stage0.json, inputs.json and the figure are unchanged, as are the verdict, the bars, the "open, Jon's call" section and the reading the stop rests on. I first ran your 52-mutant harness on b62d1da8 to get the baseline (16 caught only by the byte-compare, 4 passing the whole file, as you found), then reran it after adding the tests.

1. Fixed. New test_rule2_reads_the_lower_bound_of_C_minus_max_N_T: a hand-made case where the C − max(N, T) interval straddles 0 (about [−0.054, +0.154]) and the C − N interval does not (about [+0.04, +0.06]). Rule 2 must drop C, and the C-against-N reading must keep it. It fails against both bound mutants in rules_from_deltas: lower → upper bound, and the lower bound read from the C − N interval. _deltas gained a per-key spreads argument to build this case.

2. Fixed, all four. Each new assertion fails against its mutant:

  • one_instance < → <=: test_rule3_gain_exactly_at_the_bar_is_not_below_it (+0.02 exactly is not flagged).
  • per_split_mean_reading outcome(True, dc): test_per_split_mean_reading_keeps_rule_1_and_its_own_interval passes drop_t=False and expects "T and C". The same test gives the pooled resamples a spread wide enough to cross 0, so it also fails when the interval is taken from the pooled resamples.
  • runner_up_pooled_C_minus_maxNT against N alone: test_selection_sensitivity_on_hand_made_counts, with 144 hand-made candidates where pooled T (0.5) is above pooled N (0.2). The same test also catches "third best as runner-up" and "one arm using all candidates".
  • main, ok = ok and same → or: test_check_exits_1_when_either_file_differs calls main() unchanged with --check --out <tmp>, a fresh stage0.json from run() and a wrong inputs.json. It expects exit 1, with one same and one DIFF. No code change was needed. The test writes its own stage0.json from run() and not the committed file, so it checks the exit logic and is not a second byte-compare. An earlier draft that copied the committed file would have inflated the count below.

Also added: test_mean_f1_reading (catches max(N, T) → N and the wrong averaging axis), and a split_C_minus_N assertion in the leave-one-split-out test (catches C − T).

3. Corrected. My answer to review 1 said "seven are still caught only by the byte-compare". That undercounted, so don't quote it. By your harness it was 16 of 52 at b62d1da8 (my own baseline run agrees), and 4 more passed the whole file. With these tests, on my re-run of the same 52 mutants: all 52 fail the full file, 44 fail with the byte-compare deselected, and 8 are caught only by the byte-compare:

  • the seven data-path mutants: seed, resample count, mask removed, budapest off the rig key's other side, the rig key's primary reading, the leave-one-out gain against N, worst replaced by best;
  • the summed-count resample share computed against another bar. That share is computed inline in run(), so a test of it would need a code change, which is out of scope for this round.

4. Doc fixed. The replication note in docs/cascade_confirm_35.md now says the CRLF handling holds for the hash values only. It adds that --check compares stage0.json and inputs.json themselves byte for byte, so it reports DIFF for both in a core.autocrlf=true checkout. I reproduced that with CRLF copies of the two files in a scratch directory: DIFF twice, exit 1 (and same twice, exit 0, on the committed files). .gitattributes has no rule for analysis_out/cascade_confirm_35/. A one-line text eol=lf rule, like the one for analysis_out/cascade_cost_35/**, would make the check pass there. It is not in this round, which is limited to tests and docs.

5. Left as is. The docs/README.md status stays final, meaning the Stage 0 run is done. Whether it should change turns on Jon's choice of reading. If he picks the per-split mean, Stage 1 follows, and the row should then say so.

Checks before the push (Windows, Python 3.12.10): cascade_confirm_35.py --check same / same, exit 0. pytest -q tests/test_cascade_confirm_35.py tests/test_docs_index.py tests/test_check_all.py: 170 passed. check_all.py --ci: 42 passed, 0 failed, 12 skipped (local-cache), cascade_confirm_35 PASS in 2.2 s, exit 0. CI on 78592b52: all three jobs green (checks, pytest (3.10), pytest (3.12)), run https://github.com/ProjectSidewalk/RampNet/actions/runs/45550439680.

🤖 Generated with Claude Code — Opus 5.5, claude-opus-5-5

…e N)

Jon chose the summed-count reading of "pooled" on 2026-11-25: it is the
reading the rule's code computed before the results were known, it is how
cascade_argon_35 pools, and C's gain rests on laurens_mapillary alone. The
doc, the docs/README.md row and stage0.json's readings.choice now say
"decided" instead of "open, Jon's call". No number, verdict or bar changes;
--check is byte-identical after regeneration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jonfroehlich
jonfroehlich merged commit b789b07 into main Nov 25, 2026
3 checks passed
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