Skip to content

fix(exec): stamp demand-capture epochs against deferred stream pollution - #1092

Merged
DecisionNerd merged 5 commits into
mainfrom
fix/1091-demand-capture-epoch
Sep 4, 2026
Merged

fix(exec): stamp demand-capture epochs against deferred stream pollution#1092
DecisionNerd merged 5 commits into
mainfrom
fix/1091-demand-capture-epoch

Conversation

@DecisionNerd

@DecisionNerd DecisionNerd commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stamp physical demand-recording streams with the active capture epoch so deferred expand drops cannot mutate a later DemandSnapshot.
  • Ignore mismatched-epoch record paths (hops, filters, RSS probes, observers).
  • Add stale_capture_epoch_cannot_pollute_next_session regression for the Bazel equivalent_full_lifecycle failure mode.

Closes #1091

Test plan

  • cargo test -p graphforge-exec --lib stale_capture_epoch_cannot_pollute_next_session
  • cargo test -p graphforge-exec
  • TMPDIR=<ext4> cargo test -p graphforge-api --test scale_g500_ladder equivalent_full_lifecycle
  • Exact-head CI / CI Gate

Made with Cursor


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Deferred one-hop expand drops were mutating the next capture session's
DemandSnapshot, which failed Bazel full-lifecycle slope proof. Stamp
streams with the active epoch and ignore stale record paths.

Closes #1091

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: c0827aed-82bc-4437-ad17-b3c64fd002f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added executor Changes to query executor core Core source code changes labels Sep 4, 2026
@blacksmith-sh

This comment has been minimized.

DecisionNerd and others added 3 commits September 4, 2026 09:15
Deferred partition execute was re-reading the global capture epoch and
adopting the next session, so one-hop expand RSS/hop counters still leaked
into optimized two-hop snapshots under Bazel. Bind the epoch on Expand,
RSS/filter probes, and OrderedTwoHop at optimize time.
Process-global demand capture was still adopting another test's live epoch when
uncaptured execute planned under an active capture session, which leaked one-hop
expand counters into optimized two-hop snapshots under Bazel. Bind the capture
epoch to the capturing thread (inherited across block_on workers), make
enable/epoch/snapshot transitions atomic under one mutex, and only instrument
when the bound session matches.

Co-authored-by: Cursor <cursoragent@cursor.com>
Thread-bound capture correctly stopped concurrent executes from adopting a
live session, but gating FixedHopDemandRule on may_instrument_demand dropped
behavioral demand_batch wrapping that fixed_hop_limit explain/execute needs.

Always wrap terminal fixed-hop limits; stamp unbound plans with epoch 0 so
records no-op; bind the calling thread in reset() for the legacy
reset/execute/disable path; gate RSS and plan-completion writes on the bound
session.

Co-authored-by: David Spencer <DecisionNerd@users.noreply.github.com>
@DecisionNerd
DecisionNerd merged commit 10a63a9 into main Sep 4, 2026
39 checks passed
@cursor
cursor Bot deleted the fix/1091-demand-capture-epoch branch September 4, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core source code changes executor Changes to query executor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(exec): stamp demand-capture epoch so deferred expand drops cannot pollute the next session

2 participants