Repository navigation
docs(plans): split the IO cost fields out of E1b as E1c, for the LOCAL session - #208
Conversation
…L session On 2026-10-08 the maintainer decided that the IO cost-field change (the history renamed CostHistory / cost_history, Cost the §8.5 (1 x 3) breakdown) gets its own PR, landing before A6 and implemented by the LOCAL session, tracked in the plan as E1c. This replaces the plan's earlier recommendation to carry the change in A6's PR; waiting for all of E1b was the third option. E1c keeps reference_ltv_io's payload and its Cost key (the history): the generator, the Octave validator and the Python consumer map that key, so no locally generated (non-canonical R2024a) vector bytes are committed before A2 for a vector A6 rewrites anyway. Today's process would allow a committed regeneration (testdata/README.md:39-44); the mapping avoids it. §5 item 3 is the implementation brief: spec commits first (§8.12.2, §8.12.9, §8.12.11, the §8.12 Verified-by line, cosmic/output.md, EXAMPLES.md §3.11), every call site in both ports, invariant tests plus a spec-derived term check, a local generator check, and a CHANGELOG.md breaking entry. CostHistory is specified with its current semantics (length varies by path; single entry on the fast path); changing the fast-path convention (K11) stays with D10. Also: E1c joins the must-do set because A6 depends on it (as A5 does); the A2 -> A6 dependency the plan's §10.3 already implies is made explicit in §0.1 and §9; inventory now 44 rows, 25 groups, 28 issues. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wz15nbQvZAdxgAMJ9nkuvf
pdlourenco
left a comment
There was a problem hiding this comment.
Review of PR #208 at 717ae63
Posted as a comment review because this session's GitHub identity is the PR author. The verdict is: approve. No blockers. The four optional points below can land now or be folded into the E1c PR.
Scope. The plan diff against be4d52b. I review it as the session that will implement E1c, so the main check was whether the brief can be executed as written: every citation, every call site, and every behavioural claim, checked against the tree.
Verified
- CI is green on
717ae63: both lint jobs, the strict site build, and the MATLAB and Octave jobs. - Every line citation in the E1c brief matches
main.SPEC.md::1478contains "holds for the value reported in theCostfield";:1586is the §8.12.9 row;:1617is the usage plot;:1832is theVerified by:line.- Spec contracts:
output.md:159;EXAMPLES.md:1243,:1266.EXAMPLES.mdis at version 1.0.1, so 1.0.2 is the right PATCH bump. - MATLAB
sidLTVdiscIO.m::56,:100,:145–147,:166,:214–225,:312,:518. - Other MATLAB:
sidResultTypes.m:162;matlab/README.md:145;exampleOutputCOSMIC.m:109,117;test_sidLTVdiscIO.m:32,:222–228,:399–400,:848,:931,:948–949. - Python:
ltv_disc_io.py:117,:191,:276,:396–401,:416,:676–730;_results.py:266–267;python/README.md:129. - Testdata:
generate_reference.m:570;validate_reference.m:223–224and theresult.(name)lookup at:301;test_cross_validation.py:1127. - Process:
testdata/README.md:39–44;tests.yml:167–171and:173–191. The rootCHANGELOG.mdhas a### Changed (behavioural — review before upgrading)heading under 0.2.0.
- Call-site coverage is complete. I grepped both ports, the tests, the examples, the notebooks,
docsite/and the spec for everyCost/costuse on an IO result. Every use the brief does not list belongs tosidLTVdisc/ltv_disc, which already have the (1×3)Cost:- MATLAB:
exampleLTVdisc.m,test_sidLTVdisc.m. - Python:
example_ltv_disc.ipynb. - Testdata:
generate_reference.m:306(r5) and:807(r_vc);test_cross_validation.py:663,:1378. docsite/has no IO cost reference.
- MATLAB:
- The
CostHistorysemantics match both ports.- Every
Jthe alternation evaluates is appended,μ > 0stages included (ltv_disc_io.py:349, inside_inner_loop). - The best iterate's
Jis appended when it differs from the last entry. - The fast path returns a single entry.
- So
Cost(1) == CostHistory(end)holds by construction, provided the breakdown is recomputed from the best tuple'sX/A/B, which the brief requires.
- Every
- Narrowing the monotone claim to
μ = 0alternations is right._inner_loop's own docstring says theμ > 0stages are a homotopy fixed point, not a descent. - Keeping the vector key is sound. The Octave validator maps keys to fields by name, so remapping in the dispatch is enough. Nothing in E1c commits vector bytes.
- The counts add up: 44 rows, 25 groups, 28 issues.
Optional
- E1c's spec-changelog record depends on an open row. "No
SPEC.mdversion bump here: the changelog of E1b's version bump lists E1c's sections" assumes E1b's spec-version row is accepted, and that row is still a recommendation.- Suggest: "…if E1b's version row is accepted; the root
CHANGELOG.mdbreaking entry records the change either way". - The same applies to D2's sections (§5 item 2).
- Suggest: "…if E1b's version row is accepted; the root
- A4 interaction. A4 sits in the A3 chain, so it lands before A6.
- A4's new structural Python loop will meet E1c's key mapping: vector key
Costcompared againstcost_history. - Suggest a clause in A4: "keep E1c's
Cost→cost_historykey mapping until A6 renames the key". Otherwise the loop's "every stored key compared" rule may be implemented as a name-for-name lookup.
- A4's new structural Python loop will meet E1c's key mapping: vector key
- A free invariant to add to the new tests. On the EM path the history has
IterationsorIterations + 1entries, depending on whether the bestJwas appended. On the fast path it has 1 entry withIterations = 0.- Stating that in §8.12.9's
CostHistoryrow gives the new tests one more spec-derived check. - It also documents the K11 convention precisely, so D10 has a stated baseline to change.
- Stating that in §8.12.9's
- Nit:
test_ltv_disc_io.py:140is thetest_monotone_costdocstring. The call sites are:79(the field-name list),:165and:374–375. Harmless.
Verdict
Approve. The E1c brief can be executed as written, and the plan changes around it (§0.1, §0.3, §9, §10) are consistent.
Generated by Claude Code
- E1c/E1b/§0.3: the spec-changelog record of D2's and E1c's sections holds only if E1b's open version row is accepted; the root CHANGELOG.md breaking entry records the change either way. - A4: keep E1c's Cost -> cost_history mapping for reference_ltv_io until A6 renames the key. - E1c: CostHistory has one entry per inner-loop iteration, so its length is Iterations or Iterations + 1 on the EM path and 1 with Iterations = 0 on the fast path; the new tests assert it. - E1c: test_ltv_disc_io.py:140 is a docstring, not a call site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wz15nbQvZAdxgAMJ9nkuvf
|
All four optional points from the review are now in the plan, in
Generated by Claude Code |
Summary
This PR records the maintainer's 2026-10-08 decision on where the IO cost-field change goes. The change renames the history
CostHistory/cost_historyand adds the §8.5(1 × 3)Cost. It now gets its own PR, which lands before A6 and is implemented by the LOCAL session. The plan tracks it as E1c.CostHistoryand the newCost, while the rest of E1b still waits on open rows. A separate PR lets the change land now.Verified by:line,cosmic/output.mdandEXAMPLES.md§3.11;CHANGELOG.md.reference_ltv_iokeeps its payload and itsCostkey, which holds the history. The generator, the Octave validator and the Python consumer map that key to the new name. This keeps non-canonical R2024a vector bytes out of the repo before A2. Today's process would allow a committed regeneration (testdata/README.md:39–44), but A6 rewrites this vector anyway. A6 renames the key when it does.CostHistorysemantics: the spec row states what both ports return today. The length varies by path, and the fast path returns a single entry. The monotone-decrease claim is limited toμ = 0alternations. Changing the fast-path convention (K11) stays with D10.Spec sections touched
None — no algorithmic change; this PR edits only the plan document. When E1c lands, it will change
SPEC.md§8.12.2/§8.12.9/§8.12.11,spec/cosmic/output.mdandspec/EXAMPLES.md§3.11, spec first.Type of change
Checks
717ae63.cosmic/output.mdandEXAMPLES.md§3.11;CostHistoryshape didn't match either port;CHANGELOG.md.testdata/*.medits;docs/plans/is not part of the published site. I checked the cell counts on every edited table.🤖 Generated with Claude Code
https://claude.ai/code/session_01Wz15nbQvZAdxgAMJ9nkuvf
Generated by Claude Code