The bridge tier is the one resolver fan-out stage with no budget, and its exemption argument is untested #110
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#110
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?
Split out of #65, which shipped in v0.23.0 and is now closed. This is its acceptance item 7 — "dynamic resolver capabilities cannot bypass the same budgets" — and it is the one part that is a decision rather than an oversight. Filing it so the decision is graded instead of trusted.
The state
crates/indexer/src/resolve_budget.rsbudgets five stages:The bridge tier (
crates/indexer/src/index.rs:~6890) is not among them.Stagehas no bridge variant, so a bridge fan-out cannot degrade-with-disclosure the way every other stage can — it either completes or it does not.The argument for the exemption, which is real
It does not run at all unless a package declared a bridge and the project granted it. When it does run, its population is one component's refs of one kind × one language's symbols of one kind — bounded on both sides by construction, unlike the same-name cross products that made #65 quadratic.
That is a good argument. It is also entirely unexercised: no fixture drives a bridge at scale, and nothing asserts the bound the argument rests on.
Why it should not simply be left
#65 exists because a resolver stage nobody had bounded turned out to scale at N².⁰⁶ on a shape nobody had built a fixture for. The bridge tier is the one stage that is exempt on reasoning rather than measurement, and it is the stage that a third-party package can switch on. The exemption may well be correct — but "correct by argument, ungraded" is precisely the state #65's own budget doc warns about:
Two ways to close it, either acceptable
Stage. Cheaper to reason about and uniform — every fan-out stage budgeted, no exceptions to remember — at the cost of a budget that will realistically never bind.Option 1 is the honest one; option 2 is the one that survives a future where bridges get richer. Whoever takes it should say which and why, in the code.
Either way the exemption's reasoning belongs next to the code, not only in a closed issue, so the next reader does not have to reconstruct it.
Related
Residual of #65. Feeds #41 (scale ceilings — bridge candidate fan-out has no fixture there either) and touches #77's bridge design.
CLOSING — option 2 shipped, and the reasoning is next to the code as this issue required
Close-out lane. This is the same defect as #164, filed from the other side; both were fixed by the one change. Verified on master
552e3a2in/tmp/cosi-lane-closeoutwith this repo's own tools.This issue offered two acceptable closes. Option 2 — "give it a
Stage" — is what shipped:So the quoted
ALLin this issue's body is out of date: the bridge tier is no longer exempt, and it can now degrade-with-disclosure like every other stage (stage_budget.bridge.degraded, persisted and reported live throughResolveControl).The requirement this issue made beyond the code change
Met.
index.rs:2530-2582carries the whole argument in place: the unit (SUM over active bridges of |symbols(dest_lang, dest_symbol_kind)|), why the rate to wall clock is deliberately not claimed (no repository we can measure has an active bridge, so the stage has never run long enough to time), why loose is the safe direction here specifically (a tight budget would cost exactly the cross-language edges a package was granted, which is the feature), and the explicit statement that the point of budgeting now is the disclosure, so it can later be tightened against real values instead of guessed at. The pre-#164 comment that said "NOT BUDGET-GUARDED, and that is a decision" was rewritten rather than deleted, so the reasoning that ended in the wrong place stays readable.Gate
cargo test -p code-index-daemon --test xaml_package_e2e→ EXIT=0, 14 passed / 0 failed, includingthe_bridge_tier_is_budgeted_and_names_itself_when_it_skips(crates/daemon/tests/xaml_package_e2e.rs:697), which spawns the daemon withCODE_INDEX_BRIDGE_WORK_BUDGET=0through the production env channel and asserts no ref carriesby 90, thatbridgeis instage_budget.measured, and that the estimate equals|symbols(csharp,class)| + |symbols(csharp,method)|.corpus_stage→ EXIT=0,executed=7 unavailable=0 controls=14 (require=true)— a real corpus run, not the vacuousexecuted=0shape.What option 1 would still have given, and where it now lives
This issue's option 1 — grade the bound with a fixture over a deliberately hostile population — was not done, and that is the honest reading of what shipped. The xaml gate's equality is graded on a 10-symbol fixture, which proves the estimate counts the right relation and counts it once per bridge, but says nothing about behaviour at scale. That fixture is #41's, which this issue itself already routes it to ("bridge candidate fan-out has no fixture there either"), and #41 stays open.
One survivor recorded rather than hidden: dropping
lang = ?1from the estimate leaves the xaml gate green, because C# is the only language in that fixture holding aclassor amethod. The language filter is ungraded there; dropping it over-estimates, which is the safe direction, and grading it needs a bridge declared ontofield.Closing as a duplicate of #164, which carries the full measurement.