Repository navigation
Retain the state root a commit computed until the graph changes - #796
Conversation
After an executable-operation Action commit, the next reading of the frontier state root hashed the whole reachable state again, although the commit had just computed it. The next tick paid for that when it resolved its frontier basis. WorldlineState now retains the root its commit computed, bound to the root key it was computed under. state_root returns it without hashing. Any mutable access to the graph drops it. To make that hold by construction, the graph field is private to its module. Mutation goes through warp_state_mut, which drops the retained root, or apply_patch_journaled, which drops it only when the patch applied. The engine rebuilds a state through from_parts instead of a struct literal. A rollback marker carries the retained root of the graph it restores. Debug builds assert that a retained root equals the hashed root. Refs #782. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 42 minutes. View limit details
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 200cf2edb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Address review: the comment still said every call hashes the whole reachable state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent agy review at The review proved the central claim: it enumerated every write of the graph, the root key and the retained root inside
Since then |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rustdoc warnings gate rejects the link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 401203c7c0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8c53b41e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
It counts the hashes every build performs and excludes the hash by which a debug build checks a retained root, so the count is the same in both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changes
After an executable-operation Action commit, the next reading of the frontier's state root hashed the whole reachable state again, although the commit had just computed it. The next tick paid for that when it resolved its frontier basis.
WorldlineStateretains the root its commit computed, bound to the root key it was computed under.state_root()returns it without hashing.warp_state_mut(), which drops the retained root, orapply_patch_journaled(), which drops it only when the patch applied. About twenty call sites change from field access to the accessor.WorldlineState::from_partsinstead of a struct literal; a state built that way has no retained root.Only the Action commit paths retain a root. The native-rule engine path does not (its states are rebuilt through
from_parts), so it behaves as before.Evidence
Guarded Docker worker (Linux VM), release build, compare-and-set workload, no WAL, 40 ticks, one run each, tick p50:
For reference, the 100,000-node rows were 5.03 ms, 8.13 ms and 18.09 ms before #793.
Tests
compiler_cas_tick_hashes_the_state_once_after_the_first_commit: after a first commit, each further Action tick performs exactly one whole-state root computation on the frontier state. RED/GREEN in the guarded worker: without retention the assertion fails withleft: 3, right: 1; with this PR it passes.a_retained_state_root_is_dropped_by_any_mutable_graph_accessanda_retained_state_root_is_bound_to_the_root_key.compiler_cas_tick_wal_failure_restores_exact_runtime_and_provenance(existing) compares the runtime's debug rendering, which includes the retained root, before and after an abandoned tick.Guarded worker on this source: compare-and-set 8 (with
host_test) and 6 (without); warp-core lib 721 and 751; default-feature integration tests; pipeline 42; host loop 50; the other workspace crates' tests; compare-and-set, pipeline and host loop again in release mode; fmt; strict Clippy on the library and the compare-and-set test target in both feature sets.What remains
One whole-state hash per Action tick, about 0.5 ms at 100,000 nodes. Removing it needs an incremental state root, which changes what the root commits to and is a design decision recorded on #782.
Documentation impact
CHANGELOG.mdupdated. The design page's statement that each admitted tick computes a state root over the whole reachable state remains true.Refs #782.
🤖 Generated with Claude Code