Skip to content

Comments: NUM_SHARDS is not hashed; GenSet is per-transaction - #866

Merged
flyingrobots merged 3 commits into
mainfrom
docs/correct-shard-and-genset-comments
Oct 15, 2026
Merged

flyingrobots merged 3 commits into
mainfrom
docs/correct-shard-and-genset-comments

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Corrects two source comments that an earlier audit (the archived branch core-trace-milestone-1, preserved in the branch bundle) found false. Both are still on main, and both were rechecked against current code.

  • parallel/shard.rs. The comment said NUM_SHARDS "is recorded in the commit hash domain via compute_patch_digest_v2" and that changing it changes hashes.
  • scheduler.rs. GenSet was described as O(1), with "a new generation per transaction".
    • The generation is set to 1 and never advanced.
    • Each transaction gets fresh sets from ActiveFootprints::new.
    • Lookups go through a BTreeMap, which is O(log n).

Comments only; no behaviour changes.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified that shard count affects how work is divided and balanced, but does not change committed results.
    • Updated descriptions of transaction conflict tracking to reflect that lookup costs grow with the number of tracked keys and that tracking state is temporary for each transaction.

Two source comments, found false by an earlier audit (archived branch
core-trace-milestone-1) and still on main:

- NUM_SHARDS claimed to be recorded in the commit hash via
  compute_patch_digest_v2. No digest or state root references it; deltas are
  merged canonically, so it only affects load balance.
- GenSet claimed O(1) checks via a new generation per transaction. The
  generation is set to 1 and never advanced, each transaction gets fresh sets,
  and lookups go through a BTreeMap (O(log n)).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T08:00:58.966954Z 026919e New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

You'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 48 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: flyingrobots/echo/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 27bba5b2-a771-4434-ae89-b96076651e3f
📥 Commits

Reviewing files that changed from the base of the PR and between bf9196c and 031306f.

📒 Files selected for processing: 3
  • crates/warp-core/src/parallel/shard.rs
  • crates/warp-core/src/scheduler.rs
  • docs/spec/scheduler-warp-core.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: flyingrobots/echo/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: ef5f20fb-d8a3-425a-a22a-15504d7a0b54
📥 Commits

Reviewing files that changed from the base of the PR and between f5ceece and bf9196c.

📒 Files selected for processing: 2
  • crates/warp-core/src/parallel/shard.rs
  • crates/warp-core/src/scheduler.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The NUM_SHARDS and GenSet documentation now describes shard hashing, worker partitioning, set lifetimes, and lookup costs as implemented.

Changes: Implementation documentation

Layer / File(s) Summary
Correct implementation documentation
crates/warp-core/src/parallel/shard.rs, crates/warp-core/src/scheduler.rs
The NUM_SHARDS documentation states that shard count is excluded from digests and state roots, and affects worker partitioning and load balance. The GenSet documentation states that each transaction creates fresh sets, the generation stays at 1, and BTreeMap lookups cost O(log n).

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to bf919

The updated comments appear to match the existing behavior. No actionable merge-blocking risk remains.

### Architecture Summary

Architecture risk: 🔵 Low · up to bf919

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/warp-core/src/parallel/shard.rs: The documentation removes the claim that NUM_SHARDS is recorded in compute_patch_digest_v2 and that changing it changes hashes and requires a protocol version bump and migration. It now states that the value is excluded from digests and state roots, controls worker partitioning, and changing it affects load balance rather than hashes.
  • observed — Modified behavior in crates/warp-core/src/scheduler.rs: Replaces the description of generation-stamped sets that avoid table clearing and provide O(1) conflict checks with documentation stating that sets are fresh per transaction, their generation stays at 1 without reuse, and BTreeMap lookups cost O(log n).
Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title accurately identifies both comment corrections: NUM_SHARDS is not hashed, and GenSet is per-transaction. It is concise and specific.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf9196cc25

ℹ️ 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".

Comment thread crates/warp-core/src/parallel/shard.rs Resolved
Comment thread crates/warp-core/src/scheduler.rs Resolved
- NUM_SHARDS also caps the effective worker count, which decides how many
  per-worker deltas the parallel APIs return and which plan they select.
  Only the committed result is independent of it.
- ActiveFootprints, reserve() and the scheduler spec still described
  generation-stamped O(1) checks. They now describe per-transaction
  BTreeMap-backed sets at O(log n) per lookup.

Found by review of #866.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 026919e756

ℹ️ 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".

Comment thread crates/warp-core/src/scheduler.rs Resolved
Reservation is O(log n) per resource through BTreeMap-backed sets. Found by
review of #866.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flyingrobots
flyingrobots merged commit db986f4 into main Oct 15, 2026
43 checks passed
@flyingrobots
flyingrobots deleted the docs/correct-shard-and-genset-comments branch October 15, 2026 08:15
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