Repository navigation
fix(test-impact): a parse gap names only reached functions, variables, macros - #2970
Merged
Merged
Conversation
…, macros A partial parse leaves lines the graph has no edges from, so the engine reads a gap's text: when it names a definition the walk reached, the definition around the gap is reached too. The match took the short name of every reached node, fields and types included, and a gap outside every definition seeded its whole file. In this repository that cascaded: one replay fired 312 distinct gaps, most on words like `idx`, `n`, `index` and `used`. The file-scope gap at src/foundation/compat_thread.c:109 (`__attribute__((used))`) fired on any reached field named `used` and seeded the whole file, including cbm_mutex_init, which the memory core calls, so nearly every change reached every role handler and the runner's main (RUNNER_REACHED) through cbm_free. User decision R155 (2026-11-11): a gap's words match only the names of reached functions, methods, variables and macros of at least three characters, the kinds of definition a hidden call or read can name; and a gap outside every definition seeds the definitions that start on its own lines, never its whole file. Test: test_impact_engine_parse_gaps_name_only_reached_functions. Before the fix a changed field `used` and a changed two-letter global `nn` fire gaps in unrelated helpers, and a file-scope gap naming a reached function seeds the whole file; the existing function-name gap test still passes. Signed-off-by: Martin Vogel <[email protected]>
DeusData
added a commit
that referenced
this pull request
Nov 13, 2026
Brings in #2974 (incl. the jsonnet scanner patch) and #2970. One conflict: scripts/vendored-checksums.txt, where #2974 and the vba vendoring both rewrite the MANIFEST.md line. Resolved by taking main's file and regenerating it with scripts/security-vendored.sh --update; against main it differs only in the MANIFEST.md line and the five vba lines, and the integrity verify passes. THIRD_PARTY.md, MANIFEST.md and tests/test_parse_coverage.c merged cleanly; each equals main plus this branch's own change (identical patch-ids), and test_parse_coverage.c has 76 TEST and 76 RUN_TEST entries (71 at the merge base, +2 from main, +3 from this branch). The MANIFEST summary (164 grammars) and ABI line (9/78/77) match a recount from the tree. Signed-off-by: Martin Vogel <[email protected]>
DeusData
added a commit
to ankitsusheel/codebase-memory-mcp
that referenced
this pull request
Nov 14, 2026
Brings the branch up to main d68f491 (DeusData#2967, DeusData#2968, DeusData#2970, DeusData#2974). src/pipeline/registry.c: main (DeusData#2968) gives registry_resolve_scoped the calling definition's test verdict (`caller_test`), adds cbm_registry_resolve_ref for references (USAGE, READS, WRITES) and routes calls through a static resolve_call_lang. This branch wraps the lookups with the VB.NET case-insensitive retry. Resolved by keeping both: vb_resolve_folded takes `caller_test` and passes it to its own lookup, and the retry hooks cbm_registry_resolve_lang (false), cbm_registry_resolve_ref and resolve_call_lang (the caller's verdict), exactly as main's first lookup in each. Without the hook in cbm_registry_resolve_ref, VB.NET references would have stopped folding. internal/cbm/vendored/grammars/MANIFEST.md: main added the sql row next to the vbnet row this branch edits; both rows kept. scripts/vendored-checksums.txt: regenerated with scripts/security-vendored.sh --update; only the MANIFEST.md line differs from main. Adapted with the merge: the VB.NET registry test passes `false` as the new caller_test argument of cbm_registry_resolve_call_scoped (a production caller). Signed-off-by: Martin Vogel <[email protected]>
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.
What this changes
The test-impact engine reads the text of a parse gap (lines the C parser could
not turn into edges): when the text names a definition the walk reached, the
definition around the gap is reached too. Two parts of that rule made it fire
almost everywhere in this repository:
node, fields and types included, so words like
idx,n,indexandusedfired gaps in unrelated code;The cascade reaches code the change cannot reach. One file-scope gap shows
the mechanism:
src/foundation/compat_thread.c:109(
__attribute__((used))) fired on any reached field namedusedand seededthe whole file, including
cbm_mutex_init, which the memory core calls, sothe walk went on to every caller of
cbm_free. In the replays below theold rule kept 79-81% of the 10,302 mapped tests for every product change, and in
the setup without a team artifact it vetoed whole runs (RUNNER_REACHED
through the memory core).
User decision R155 (2026-11-11):
variables and macros of at least three characters;
own lines, never its whole file.
A gap inside a function that names a reached function still reaches that
function's callers, as before.
Replays
Setup: one base for every replay, b3ec08d (main on 2026-11-12), with its
producer bundle (graph + Linux x86_64 coverage map, 0.1 days old, admitted).
Each change is the revert of a recently merged PR on top of b3ec08d
(
git merge-tree+commit-tree, no refs): a revert touches the samefunctions as the PR, so it reaches the same code, and every replay can share
one admissible coverage map. 13 of 16 candidates revert cleanly (0d835c5,
5b87320 and f61d7c0 conflict with later commits). Old = the engine on
main (c90b1d9); new = this branch. Tests are counted at test level: a whole
suite counts all its mapped tests.
Of 10,302 mapped tests, the old engine kept 79-81% for every product change;
the new one keeps 44-45% for small changes and 74-75% for the two
pipeline-wide ones (the test-only change is the same either way).
With a bundle the old engine did not veto in this set; it over-selected: a
watcher change, for example, pulled in every language-server, grammar and
cypher suite.
The four PRs replayed for #2959 (merged PR as
M^1..M, no bundle, soevery suite runs whole and only the run-all reason matters):
main -> cbm_index_supervisor_capture_build_fingerprint -> ... -> cbm_free -> check_owned -> ..., the memory-core chain)main -> cbm_kind_in_set_free_cachemain -> cbm_kind_in_set_free_cacheThe remaining veto on 0d835c5 and 5b87320 does not come from a gap: a
debug run of 5b87320 shows no gap seeding
cbm_kind_in_set_free_cache(both PRs edit internal/cbm/cbm.h; the seed comes from the change itself).
It is outside this change and recorded for a follow-up.
Miss audit
The oracle is independent of the engine's walk: the producer bundle of the
base commit b3ec08d (its graph and its per-test coverage map, recorded on
Linux x86_64, 10,302 tests). For each replay it collects the tests the change
really needs:
suite:*) executes one;a type, a field, a function no test executed): every test executing a
function that uses it: by graph edge (up to 6 hops to the nearest mapped
caller), by name in its source text (macros, globals, types), or by member
access
->name/.name(fields).A test the new selection drops is a miss if the oracle needs it.
Result: no miss this change introduces. 9 replays, 22,551 dropped tests in
total; the oracle requires none of them (no dropped test executes a changed
function, a suite setup that does, or a user of a changed macro, global,
type or field).
oracle's coarse type rule. The change removes the field
CBMDefinition.client_route_path. Every use of that field is in a functionthe change itself edits, and those tests are selected. The 4 tests only use
CBMDefinitionelsewhere, so they cannot see the removed field.src/main.c:print_help(the product binary, not the coverage runner). Thetests that check the help text (suites
cli,daemon_bootstrap) run wholein the new selection.
engines.
Four more clean reverts (edfb824, d40ebf6, ff812bf, 14aeda1) were
stopped without an answer after 21-27 minutes (main's engine) and 6-14
minutes (this branch), to keep the replay disk bounded: both engines sat in
the snapshot build, before any gap matching (
cbm_pipeline_pass_callsonthe 35k-line tests/test_pipeline.c or the 22k-line tests/test_cli.c, or a
full rebuild after a Python change). That is a separate, pre-existing cost
(the same would run into select-tests' 30-minute budget in CI), recorded for
a follow-up. edfb824 is covered by the no-bundle replay above.
What the narrower rule gives up (accepted by R155)
enclosing definition. A changed field still reaches every reader the parser
did see (USAGE edges) and every test whose coverage executes them.
characters no longer fires. In this repository that is the function
sw(iris_export_xml.c) and the macrosQ,U,I,S,CHandc.on its lines. 217 of the 585 C-family gap ranges in the graph lie outside
every definition (44 files); before, each of them could seed its whole
file.
CI scope
workflow, job, runner or gate changes. Less over-reach means fewer suites
and tests on the test legs (x86 runs the selection, arm64/macOS/Windows its
portable view, per fix(test-impact): started roles, fork PRs, base tooling, all test legs #2959).
select-testsruns the merge base's engine(fix(test-impact): started roles, fork PRs, base tooling, all test legs #2959), so this lands for PRs whose merge base contains it. This PR's own
run uses main's engine, and a change to
src/mcp/test_impact*runseverything by rule anyway.
select-testsstays outsideci-ok; the test legsgate as before, on what they are given to run.
The miss audit above checks every dropped test against the recorded
coverage of the changed code.
TEST_IMPACT_MODE=shadow, or the'gate'default in
pr.yml); reverting this commit restores the old matching.Proof
test_impact_engine_parse_gaps_name_only_reached_functions: on main'sengine it fails with all three over-reaches (the file-scope gap's file, the
field word
used, the two-letter globalnn); with this change it passes.test_impact_engine_parse_gaps_reach_what_they_name(a gap naming areached function inside a function still selects its callers' tests)
passes before and after.
test_impact_artifact, test_impact_runner_filter, runner_isolation 99/99.
scripts/test.sh --contracts-only(every contract step, includingtests/test_test_impact_selection.sh and tests/test_lane_wiring_contract.sh)
passes; memory-core linter passes; clang-format (Homebrew LLVM) clean on the
touched hunks. cppcheck 2.20 is left to the hosted lint job.