Repository navigation
Pop-A part (a): light module-decl scan in MODULE_INDEX OnceLock (~90s/run win) - #5454
Merged
Merged
Conversation
…/run win) The test-helper MODULE_INDEX OnceLock called parse_source() (full tokenize+parse) on every .dag file under dsl/+src/v1 to extract module names. With ~428 .dag files this paid a significant parse cost once per test-process, showing up as ~90s on every rust-gate run regardless of which tests run. Fix: replace extract_module_declaration's full parse with a line scan — skip blank/comment lines, then strip "module <name>" from the first substantive line. No full tokenize or parse needed; the module declaration grammar is trivially scannable. Falls back to None (same as before) on files with no module declaration. All three module-index unit tests pass (scan_dag_files_last_wins, build_module_index_co_root_last_wins, resolver_imports_ephemeral). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
briansrls
force-pushed
the
session/warm-ram-537-pop-a
branch
from
June 21, 2026 07:16
71b6830 to
6319dac
Compare
…faithfully Add a one-line doc note explaining that the .dag grammar uses only // line comments (no block comments or attributes), so the light scan's skip rule is a faithful subset of the full header convention — not an approximation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ackages only The freshness check in ci_spec.dag scanned all of `$ROOT/src` for `.rs` files newer than `claim_executor`/`gunbc`. This fires as a false positive when only `src/v1/tests/` (v1-compiler-tests) changes — that package is not in the binary dep graph, so cargo correctly skips the rebuild, but a cached binary's mtime precedes the freshly-checked-out test helper's mtime. Fix: enumerate the three actual source packages (`stage0`, `stage0_core`, `stage0_emit_core`) instead of scanning the whole `src/` tree. Regenerated ci.yml via `main_wet` on dsl/tools/ci_yaml_gate.dag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
The test-helper
MODULE_INDEXOnceLock (insrc/v1/tests/src/helpers.rs) calledparse_source()— full tokenize+parse — on every.dagfile underdsl/andsrc/v1/to extract module names for the import-resolution index. With ~428.dagfiles this paid a significant parse cost once per test process, manifesting as ~90s of overhead on every rust-gate run (proud-deer #5447 measurement).Fix: Replace
extract_module_declaration's full parse with a line scan — skip blank///-comment lines, then stripmodule <name>from the first substantive line. No tokenize or parse needed; the module declaration grammar is a simple prefix. SameNonesemantics for files without a declaration.scan_dag_files_last_wins,build_module_index_co_root_last_wins,resolver_imports_ephemeral)interp_recorded_fixturefailures are from Implement the realization-vocabulary containment guard lens per docs/plans/emission-ingestion-inverse.md section 5: a sibling rule over v2.lens.layering_imports LayerImportFact rows flagging RealizationVocabularyLeak when a non-realization-edge module imports the bash-AST sidecar extdeps.languages.b #5445 (inherited main red), not this change — verified by running on origin/mainTest plan
scan_dag_files_last_wins_on_duplicate_module_names_without_panic— okbuild_module_index_co_root_last_wins_on_duplicate_module_names— okresolver_imports_ephemeral_generated_source_root— ok🤖 Generated with Claude Code