tech-debt-backlog §5.14: clarify near-zero polysemy column display - #82
Merged
Conversation
The mango (6) and papaya (7) cells in larql-polysemantic-hierarchical tabulated `0.000`, which rounds correctly from the computed magnitudes (~1.1e-4 and ~6.2e-5) but reads as exactly zero. Cells now show `≈0.000 (1.1e-4)` / `≈0.000 (6.2e-5)`, and a short paragraph after the tier-summary line documents the rounding convention and cross-references the demo's `< 0.05` ASCII heatmap threshold. No code or test changes — the pipeline test recomputes the Gram from the parsed machine, so the prose/table edits are unobserved by assertions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jascal
commented
May 29, 2026
jascal
left a comment
Owner
Author
There was a problem hiding this comment.
Code Review — Claude Sonnet 4.6
Verdict: LGTM — approve in spirit (comment-only). Accurate, well-scoped doc-only change that fixes a genuinely misleading display. I independently reproduced every numeric claim.
What this changes
examples/larql-polysemantic-hierarchical.q.orca.md: mango (6) / papaya (7) polysemy cells go from bare0.000to≈0.000 (1.1e-4)/≈0.000 (6.2e-5), plus a clarifying paragraph documenting the 3-dp rounding convention and cross-referencing the demo's< 0.05heatmap threshold.openspec/changes/tech-debt-backlog/tasks.md: marks §5.14 done with a resolution note.
Correctness — verified
I ran compute_concept_gram_mps against the parsed machine and confirmed the magnitudes to the digit:
gsq[0,6](mango) =1.0908e-4→ rounds to0.000at 3-dp,1.1e-04at 2 sig figs ✓gsq[0,7](papaya) =6.1694e-5→ rounds to0.000at 3-dp,6.2e-05at 2 sig figs ✓- The "left as-is" rows are also exactly right: strawberry
0.063, blueberry0.055, car0.063, bike0.055— all above the 3-dp floor, correctly untouched.
The cross-reference is accurate too: demos/larql_polysemantic_hierarchical/demo.py:85,91,99 defines the heatmap tiers as blank < 0.05, so mango/papaya (~1e-4) do render blank exactly as the new paragraph claims.
Tests & lint
pytest -k larql_polysemantic_hierarchical→ 1 passed. The pipeline test recomputes the Gram and asserts tier bands, so it is genuinely unaffected by prose/table edits — confirmed.pytest tests/test_concept_gram_mps_contraction.py tests/test_examples.py→ 58 passed, 1 skipped, matching the PR's test-plan claim exactly.ruff check .reports 3 errors (tests/test_compiler.py:1755unusedcr_min,tests/test_examples.py:320unusedcr_min,tests/test_mcp_server.py:18unusedimport os). None are introduced by this PR — the diff touches only two.mdfiles, so these are pre-existing onmain. Not a blocker here, but worth a separate cleanup pass.
Style
- The
≈glyph is consistent with existing unicode in this file (≤ 0.14on line 146,≲ 0.09on line 153), so it reads naturally. - Good judgment showing the bracketed scientific magnitude only on the rows where the 3-dp display collapses to
0.000— adding it to the 0.05–0.06 rows would be noise. The fix is precisely targeted at the actual ambiguity.
Minor observations (non-blocking)
- The 0.055 rows sit right on the heatmap boundary. blueberry (5) and bike (9) compute to
0.055, which is just above the demo's< 0.05blank threshold, so they render as.rather than blank. The new paragraph only claims mango/papaya render blank (correct), but a reader cross-checking the heatmap against the table might briefly wonder why the 0.055 entries aren't blank given how close they are to the floor. A half-sentence noting that0.05is a heatmap display tier (not a structural cutoff) could pre-empt that, but it's genuinely optional. - tasks.md note is thorough — the inline verification values and the rationale for leaving the ~0.06 rows alone make this self-documenting for the next reader. Nice.
No correctness, security, or performance concerns. This is the right fix for a low-severity display-accuracy issue, and the numbers are all reproducible.
This review was posted automatically by Claude Sonnet 4.6.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/larql-polysemantic-hierarchical.q.orca.mdas≈0.000 (1.1e-4)/≈0.000 (6.2e-5)instead of bare0.000, so a reader runningcompute_concept_gram_mpsdirectly does not read the rounded display as exactly zero.< 0.05ASCII heatmap threshold.openspec/changes/tech-debt-backlog/tasks.mdwith a resolution note.Why these magnitudes
Verified against
compute_concept_gram_mpson the parsed machine:1.091e-046.169e-05Both round to
0.000at 3-dp display. Other cross-group entries (strawberry,blueberry,car,bikeat ~0.06) are above the rounding floor and keep their plain0.063/0.055form.Scope
Doc-only — no code or test changes. The pipeline test
tests/test_examples.py::TestExamples::test_larql_polysemantic_hierarchical_pipelineparses the machine and recomputes the Gram, so its tier assertions are unaffected.Test plan
pytest tests/test_examples.py::TestExamples::test_larql_polysemantic_hierarchical_pipeline— passespytest tests/test_concept_gram_mps_contraction.py tests/test_examples.py— 58 passed, 1 skippedSource
2026-05-01 PR #48 self-review (recorded as §5.14 in
tech-debt-backlog).