Skip to content

warp-core: one canonical delta merge for every build - #850

Merged
flyingrobots merged 3 commits into
mainfrom
fix/single-delta-merge
Oct 14, 2026
Merged

flyingrobots merged 3 commits into
mainfrom
fix/single-delta-merge

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What

Fixes #813: the merge the engine shipped was not the merge the tests ran.

Before.

  • merge_deltas (parallel/merge.rs) served test and delta_validate builds.
  • Every other build used a second implementation in engine_impl.rs: sort by key, compare neighbours, dedupe, then check writes to new warps.
  • The dedicated merge tests are gated on delta_validate. CI already runs them in the step cargo test (delta validation and the canonical delta merge), which the gates work added after the audit.

After.

  • merge_canonical is the only implementation. It is generic over the writer identity: OpOrigin in builds that record origins, () in those that do not.
  • The origin orders operations that share a key and names writers in a refusal. It cannot change which operations are accepted, or their order, because only identical operations survive under one key.
  • merge_deltas and the shipped engine path both call it, keeping their existing error mapping and messages.
  • The release-only helpers find_write_to_new_warp and check_write_to_new_warp are gone.
  • Four unit tests run the core with () and with origins on the same inputs and check they agree: identical writes collapse, divergent writes are refused, a write to a warp opened in the same tick is refused, and an open alone merges.
  • CI: no change. An earlier revision added a step that duplicated the existing one, and review caught it.

Evidence (guarded container)

Run Result
cargo test -p warp-core; integration tests link the library without cfg(test), so they exercise the shipped path 1,489 pass
warp-core with native_rule_bootstrap,trusted_runtime,host_test 1,801 pass
The six delta_validate merge targets 51 pass
cargo build --release -p warp-core Clean
Clippy, all targets: runtime features with delta_validate, default, --release, delta_validate Clean
cargo fmt --check Clean

The test suites ran before two later fixes that affect only lint: gating the re-export to the builds that use it, and allowing panic! in the test module. Lint and the merge unit tests were re-run after them.

Fixes #813.

🤖 Generated with Claude Code

The engine shipped its own merge (sort by key, compare neighbours, dedupe,
then check writes to new warps) when neither test nor delta_validate was on,
while merge_deltas served test and validation builds. The merge tests ran
against merge_deltas, so the shipped merge was not the tested one.

merge_canonical in parallel/merge.rs now holds the only implementation,
generic over the writer identity: OpOrigin where builds record origins, ()
where they do not. merge_deltas and the shipped engine path both call it.
The release-only helpers find_write_to_new_warp and check_write_to_new_warp
are removed. Unit tests run the core both ways on the same inputs and check
they agree.

CI now runs the six delta_validate merge test targets, which no job ran
before.

Fixes #813.

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

chatgpt-codex-connector Bot commented Oct 14, 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-14T08:56:43.602098Z 7975f7e 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 14, 2026 •

Copy link
Copy Markdown
Contributor

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 50 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: 16b85c8e-d238-43f2-8544-32f85258dea2
📥 Commits

Reviewing files that changed from the base of the PR and between b51c4e7 and 7975f7e.

📒 Files selected for processing: 3
  • crates/warp-core/src/engine_impl.rs
  • crates/warp-core/src/parallel/merge.rs
  • crates/warp-core/src/parallel/mod.rs
  • 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: 961eabc919

ℹ️ 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 .github/workflows/ci.yml Outdated
The test-warp-core job already runs these six targets, with
parallel_engine_worker_invariance and the library tests, under
delta_validate. Found by review of #850.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flyingrobots
flyingrobots merged commit 9000695 into main Oct 14, 2026
43 checks passed
@flyingrobots
flyingrobots deleted the fix/single-delta-merge branch October 14, 2026 08:59
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.

Two implementations of the canonical delta merge

1 participant