Repository navigation
Lane cost failures identify each sample's completion and errors - #861
Merged
Merged
Conversation
Keep diagnostics attached to the naturally attempted shape and size so a cost failure identifies its own incomplete parse or walk. Keep the original timing judge, inputs and limits. Signed-off-by: zlareb1 <[email protected]>
Signed-off-by: zlareb1 <[email protected]> # Conflicts: # tests/unit/test_code_regex_cost.py
This was referenced Nov 18, 2026
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.
Related: #841
Related: #854
Changelog category (leave one):
Why
A lane cost failure names its input shape, but captured parser warnings cover the entire registry. Those warnings cannot identify whether the failed shape completed its parse and walks. Retain completion and error evidence for each naturally attempted sample and include the failed shapes' records in the assertion.
Scope and risk
Two test files change. Each sample records its requested size, source bytes, adjusted CPU, parsed bytes, lane match, tree presence, completion and fixed error categories. Sample records are appended after the existing CPU interval; exception classification runs only on existing error paths. Records contain generated-input measurements and exception classes, never exception bodies or parsed objects.
The original timing judge, retries, generated inputs, thresholds, parser limits, GC handling, native-parser CPU exclusion, deadlines and pass conditions stay intact. All original attempts are reported because CPU minima may come from different attempts. The child still returns the original timing tuples, within an internal JSON envelope carrying the diagnostics. This repairs failure attribution; it does not repair or qualify the observed cost failure.
Compatibility, rollout and rollback
Tests
python -m pytest -qand these nodes fromtests/unit/test_code_regex_cost.py:test_judged_step_tells_a_cache_step_from_growth_over_linear,test_a_lane_parse_that_fails_is_not_finished,test_lane_walk_diagnostics_keep_samples_separate,test_a_parse_error_a_walk_swallows_is_not_finished.git diff --checkpass. An AST comparison confirms the timing judge is identical.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (Codex wrote the diff); error attribution, sample isolation and unchanged timing decisions were checked.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass; the integration suite passes if server behaviour changed.