claim_domain_scale moved ONE wall-clock ratio to #[ignore] and left its sibling live — the sibling is a FLOOR, which contention breaks in the direction a floor cannot survive #253
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#253
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
the_routing_scan_is_the_product_of_claims_and_keys_and_the_key_total_is_what_bounds_itwent RED in a local
cargo test --workspaceat load average 37.9 (a concurrentsession was running cargo in another worktree):
1.88×, against
assert!(big_ms > small_ms * 2.0).Re-run isolated at load 3.0 on the same tree: PASSES (
4 passed; 0 failed; 1 ignored,5.70 s versus 8.80 s contended). CI's
cargo testjob also passed it atbd1c4e2. So itis contention, not a regression — but the failure message says "the scan did not grow
with the file count", which is a claim about the product, and that is the wrong verdict
to hand a reader.
Why this is a finding and not just flakiness
This file has already been here, wrote it up carefully, and fixed the OTHER instance.
From its own module doc:
the_cost_of_a_claim_domain_is_linear_in_the_files_it_holdswas therefore moved to#[ignore], executed by the weeklyplugin-path-costjob on an idle runner, andregistered in
release_gate.rs::TIMING_GATESso the#[ignore]could not quietly becomea measurement nothing runs.
The sibling three hundred lines below was left live, with the identical construction:
two sequential
Instant::now()arms insidecargo test --workspace.And the direction matters. The quoted paragraph describes a spike landing on the
NUMERATOR, inflating a ratio and breaking a ceiling. This one is a floor, so the
spike that breaks it lands on the DENOMINATOR —
small_msruns first and absorbs thecontention, compressing the ratio toward 1. Same mechanism, opposite arm, and a floor is
exactly what it kills.
The obvious fix does not work, and the test says why
My first instinct was to assert on the machine-independent unit this file itself
establishes — bytes allocated, which it measured as byte-identical across
opt-level=0and
lto=thinwhile the wall clock differed 25x.That is refuted by the test's own final assertion:
The bytes are equal by design: the whole point of the case is that the routing scan is
invisible to the byte counter. That is the fact being recorded. So bytes cannot be the
anti-vacuity guard here, and
measure()returns only(value, bytes, peak)— bothallocation measures — so the fixture offers no other machine-independent signal. The time
assertion is there because it was the only thing left.
Options
#[ignore]+ register inrelease_gate.rs::TIMING_GATES+ run it on the weekly idle-runner job, exactly as itssibling was handled. Cheapest, consistent, and needs no new instrumentation.
Key::matchescall counter behind atest-only cfg would be a property of the code and the data, which is the requirement
the module doc states. More faithful to the intent, more invasive.
Not folded into the change that found it: the failing test is unrelated to that diff
(it exercises
crates/indexer/src/dirty.rs, and the diff touches nosrc/at all), andpicking between the two options is a decision this file has earned the right to make
deliberately.
link_payload_scaling_e2e's per-link ceiling grades the TEMP DIRECTORY'S LENGTH — 59 tokens on/tmp, 80 on a long path, 63 on the Windows runner #252The likelihood of this firing went up materially today, and the mechanism is measurable. Adding it here because it changes the urgency without changing the decision.
3aea49dun-brokeOSS corpus (tier 1). That job had been aborting atcorpus_stagearound 25 min; it now runs everything and takes ~54 min.cargo testshares the runner pool:cargo testbd1c4e25131654So the per-push window in which a sequential wall-clock ratio is measured under contention has roughly doubled. A sibling test in a different file —
xaml_large_file_budgets::the_fact_buffer_ceiling_fires_and_says_so— failed on that very run for the same underlying reason (a timing bound beaten by a loaded machine), which is #254.Checked, so the next person does not have to
Registration is not a blocker for option 1.
release_gate::TIMING_GATESaddresses the binary:and ci.yml's weekly job runs
--test claim_domain_scale -- --ignored --nocapture --test-threads=1, which picks up all ignored tests in that binary.ignored_test_reachabilitysweeps the population and demands each ignored test be reachable or waived — a second#[ignore]here is reachable through the existing invocation, so it needs no new plumbing.But option 1 costs more than it looks, which is why I did not just do it
The wall-clock assertion is a precondition for the one that follows it:
#[ignore]moves the whole test to the weekly runner, so per-push loses the byte-equality assertion as well — not just its fragile guard. That is a real reduction in per-push coverage, traded for stability, and it is exactly the kind of trade that should be made deliberately rather than under CI pressure.Option 2 (count
Key::matchescalls behind a test-only cfg) keeps both assertions on every push and replaces the fragile precondition with a property of the code and the data, which is what the module doc says the unit should be. It costs instrumentation.I still think that is the better answer, and I am deliberately not deciding it as a side effect of a CI-stability push.
Released in v0.28.1, build
340a75a, via #264 and #265. Release CI passed, including the Windows archive round-trip smoke test. The routing regression now counts executed Key::matches comparisons around each scan. Both arms prove nonzero work and the 4x input proves 4x comparisons; allocation equality remains its separate assertion. The check stays in normal CI, with no contention-sensitive wall-clock floor and no widened tolerance. Workspace CI passed on Linux and Windows. Closing the deterministic-work fix.buildagent referenced this issue2026-09-11 20:25:15 +02:00