Skip to content

Lane cost failures identify each sample's completion and errors - #861

Merged
zlareb1 merged 2 commits into
mainfrom
test/lane-cost-attribution
Nov 18, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
test/lane-cost-attribution

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #841
Related: #854

Changelog category (leave one):

  • CI Fix or Improvement

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

  • Wire: no product changes; the test child and its reader change together.
  • Operator steps: none.
  • Rollback: reverting removes sample diagnostics; no stored data changes.

Tests

  • Four directly related checks pass: the existing timing judge, degraded parse completion, failed-walk diagnostics with a successful sibling and continued edge processing, and a swallowed native parser error attributed to its sample.
  • Reproduce with python -m pytest -q and these nodes from tests/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.
  • Ruff lint and formatting and git diff --check pass. An AST comparison confirms the timing judge is identical.
  • All 42 current-head PR checks and all three applicable workflows pass, including all six unit shards, coverage, floors, offline benchmarks and native/Postgres integrations. No broad suite ran locally. Earlier hosted cost failures remain failures; no cause or performance fix is claimed.

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 typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • No generated contract changes.
  • No migration changes.
  • No plugin behavior changes.
  • No frontend changes.
  • This description names operator steps and wire changes.
  • Repository text contains no deployment details or private content.
  • Commits are signed off.

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
@zlareb1
zlareb1 merged commit 62f2d0d into main Nov 18, 2026
42 checks passed
@zlareb1 zlareb1 mentioned this pull request Nov 18, 2026
6 tasks done
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