Skip to content

perf(proximity): use bounded caller adjacency for qualitative hints - #4790

Open
ScriptedAlchemy wants to merge 12 commits into
masterfrom
fix/4416-bounded-caller-neighborhood
Open

ScriptedAlchemy wants to merge 12 commits into
masterfrom
fix/4416-bounded-caller-neighborhood

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Issue

Refs #4416 — focused graph-neighborhood correctness/performance slice, not full issue acceptance. No Kev/decision-model work.

Implementation

  • Replace broad graph.impact() reports for qualitative caller/test hints with bounded, generation-pinned callers() batches; preserve depth-2 caller hints, depth-3 test evidence, and independent two-hop dependencies.
  • Distinct caller roots/neighbors count once against traversal budgets. Missing batches and over-budget caller closures are treated as partial, not as proven absent relationships.
  • Deduplicate outgoing dependency seeds, reject truncated/malformed per-seed adjacency, and exercise two-hop cycle behavior (commits 1826d405, 2f0930f4).
  • Earlier commit cb30baf8: reuse the already-fetched outgoing callees() first-hop batches from direct relationship checks in the transitive dependency closure. Avoid two redundant first-hop graph reads for a path pair requiring both sides' transitive analysis.
  • Report partial coverage when the bounded 32-symbol seed selection omits symbols. Validate direct adjacency batch sizes before interpreting any unmatched results as a negative hint. A positively observed hint remains available but is marked partial when input seeds were truncated.
  • Behavioral tests verify deduplicated seeds, bounded traversal and cycles, first-hop reuse (exactly one additional second-hop read), missing adjacency refusal, and truthful seed-limit coverage.

Verification

  • Commit cb519ba: when a direct dependency points to another selected graph seed, reuse that seed's already-fetched adjacency during the two-hop closure. Preserve discovered root/cycle evidence without a redundant second-hop query. Two new falsifiable Rust regressions assert exact second-hop frontiers for connected roots and zero extra reads for self-/cross-root cycles. This one-file patch was diff-reviewed against b5ad368 (43 added/6 deleted), appended without force under the expected old head, preserving all peer commits.
  • At the current head cb519ba1654bf5b4060ad5cbdf64e7d97cc7f3ff, this PR changes only crates/tracedecay-application/src/advisory/proximity_runtime/authority.rs. The previous updates remain in history. The latest commit is a child of b5ad368 and was published with force=false and a matching expected-old-head lease.
  • The newest Rust behavioral regressions have not yet executed. Bazel and native macOS are unavailable in the authoring runtime. Await hosted Bazel CI for the exact new head before drawing test/merge conclusions.
  • Prior head 1826d405: hosted Bazel run 42433277177 had nonzero passing application tests, but the broader Linux fleet failed three automation-scheduler tests outside this file.
  • Previous head 2f0930f4: run 42437742003 was still in progress when this metadata was updated. It cannot verify the new change.

Latest correctness/performance repair (2026-11-08)

  • Commit 21898591b38f moves the complete shared-caller test ahead of second-hop outgoing dependency expansion. Previously, an over-budget or failed unused dependency read could erase an already-proven higher-precedence shared-caller relationship. It also avoided useful unnecessary graph work.
  • Two falsifiable Rust behavioral regressions verify zero second-hop outgoing reads when callers are shared, and exactly one additional outgoing read per side for a real two-hop shared dependency. The change preserves first-hop adjacency reuse, direct-relation precedence and partial-coverage propagation.
  • The commit is an exact single-file fast-forward child of cb519ba and was pushed with force=false and a matching expected-old-head check. The exact 199-addition/88-deletion diff was source-reviewed. No new Rust/Bazel test pass is claimed; hosted CI on this head is required.

Remaining acceptance

#4416 remains open: numeric threshold/configuration/schema/UI retirement and Loom/feedback end-to-end verification are separate outstanding acceptance. No "Fixes" closure or merge is claimed here. PR-maintenance handles eligible CI/merges; held draft #4776 and beta.99 #4763 remain untouched.

Preserved affected-test evidence on incomplete dependency reads

Commit 2fd8d4bf adds a correctness repair: when both three-hop incoming caller closures have proved an affected test, a later incomplete second-hop outgoing read now retains that positive SharedTest hint marked Partial. Successful, complete shared-dependency evidence still wins its higher warning-class precedence. Previously the later refusal suppressed an already-proven test relationship entirely.

The new nonzero behavioral regression exercises failed left and right second-hop reads (with exact early-stop read counts) and successful shared-dependency precedence. The existing depth-three test metadata fixture was factored, not weakened. One-file diff against old head 21898591 was independently inspected; 127 insertions / 35 deletions (including the fixture move). Update was a non-force expected-head fast-forward, preserving all existing commits.

Verification: the new Rust regression has not yet executed via Bazel. No native macOS evidence is claimed. CI for the current head must demonstrate nonzero //crates/tracedecay-application:unit_test and :application_suite and all relevant gates; keep #4416 open (numeric threshold/schema/UI retirement and Loom journey are not addressed here).

Hosted rustfmt gate repair

Commit cbbf871 applies all 11 exact formatting hunks reported by the previous-head Repository gates. The repair was assembled from the actual pinned Rustfmt job log, validated against each unique source context, and independently compared with the prior head (one file, 49 additions / 25 deletions); no intended behavioral change. Published by nonforce fast-forward with expected old head 2fd8d4bf. This fixes the observed format drift only: exact-new-head hosted Bazel format/Rust tests still require nonzero execution and passing results before merge.

Latest CI repair — Clippy (2026-11-08)

Commit f32face1 replaces the single unnecessary cloned reference in the dependency-neighborhood Rust test with std::slice::from_ref(&direct). The prior-head CI run 42457473999 passed Repository gates but failed Clippy at authority.rs:1525 (cloned_ref_to_slice_refs under -D warnings). The expected-old-head cbbf871 was confirmed and the update fast-forwarded with force=false; compare shows one test file, one insertion and one deletion. No assertions were weakened. Full Rust/Bazel tests and native macOS remain unverified on this new head; the issue stays Refs #4416 and open.

Latest CI source fix — hosted Rustfmt (2026-11-08)

Commit 8bae143a applies the one exact Rustfmt hunk reported by Repository gates in prior exact-head CI run 42461760176: the assert_eq! in the graph dependency regression is formatted into the required multi-line expression. The diff is one file, five insertions/one deletion; no assertions or production behavior changed. Independently reviewed the patch against the hosted job diff and fast-forwarded under the verified old head without force. New-head Bazel/Rust tests have not yet executed; no test pass or issue completion is claimed. Separate Clippy run at the prior head also suffered 504 Gateway Time-out fetching hermetic-launcher prebuilt artifacts, so its failure is not a verified Rust-source error. #4416 still needs the numeric threshold/schema/UI retirement and Loom journey.

Avoid materializing graph-impact reports for relationship hints.
Refuse incomplete caller closures instead of treating them as absent.

Refs #4416
@changeset-bot

changeset-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8bae143

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Owner Author

Published b5ad3684839748d35e24a9ae809e547e6a0c3248 directly through GitHub, preserving the current cb30baf8 implementation and peer fixes. The reviewed commit adds only three behavioral unit tests in authority.rs: (1) third-hop test identity is retained once at the exact unique-symbol budget without a fourth graph read, (2) a failed read at any of the three hops refuses the result instead of returning incomplete evidence as complete, and (3) empty caller/dependency neighborhoods issue no unnecessary reads.

The exact parent-to-commit diff contains only test additions; publication used expected_sha=cb30baf8..., force=false, and the PR head was independently re-read as b5ad3684 afterward. These Rust tests have not run locally: no supplied checkout/Bazel toolchain or native macOS execution is available here. Exact-head hosted CI 42443332489 is queued, not passed. Refs #4416; this test addition does not establish complete issue acceptance. No decision-model PR or release was changed or merged.

Skip outgoing second-hop reads for roots whose adjacency was already
fetched in the first hop. Preserve the reached-root relationship evidence
while avoiding redundant graph queries and exhausting fewer read budgets.
Add regressions for connected roots and self-/cross-root cycles; previous
behavior issues redundant reads and fails those assertions.

Refs #4416
Evaluate complete shared-caller adjacency before lower-priority outgoing
second-hop dependencies. Preserve an already-proven caller hint when an
unneeded dependency lookup would refuse its read budget. Keep direct
relation precedence, bounded seed coverage, and cached first hops.

Add two behavioral regressions that require no dependency queries for
shared callers, and exact second-hop reads for real shared dependencies.

Refs #4416
Preserve a shared third-hop affected-test relationship when the later
higher-priority dependency closure refuses a read. Mark the known
positive hint partial instead of publishing no relation; complete
shared-dependency evidence still takes precedence.

Factor the existing test metadata fixture and add nonzero behavioral
regression covering left/right second-hop refusal, short-circuit read
counts, and successful dependency precedence.

Refs #4416
Apply all eleven exact rustfmt corrections reported by the hosted
Repository gates on the existing issue-specific PR. No intended
behavior changes; preserve every concurrent graph repair.

Refs #4416
Use std::slice::from_ref in the real dependency traversal regression.
This resolves the exact blocking -D warnings diagnostic reported by
hosted Clippy on the current PR head; test behavior stays unchanged.

Refs #4416

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Apply the exact source changes requested by the first failing hosted
Bazel Rustfmt gate at the preceding PR head. No behavior or assertions
change; all existing regression tests are preserved.

Refs #4416

Verification: source contexts checked against hosted Rustfmt diffs.
New-head Rust/Bazel tests require hosted CI.

This branch has not been deployed

No deployments
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