Repository navigation
U3 (D-RU-3): cross-rule CSE in crepe-plan-probe - #1653
Draft
AdaWorldAPI wants to merge 7 commits into
Draft
AdaWorldAPI wants to merge 7 commits into
AdaWorldAPI wants to merge 7 commits into
Conversation
cse.rs lays out the distinct sides of all rules' stars once, over one shared domain, writes each rule as And(Sym(side)), lifts parts two or more rules share into lets (contract::set_program::share) and runs them through relalg::run_program. The tuples are read per rule with native::tuples_over_mask, the per-rule pipeline's own read, moved into a helper (behaviour unchanged: the existing 41 tests pass). examples/rule_cse.rs: 256 rules Out(k,x,z) <- R_g(x,c), S_g(c,z), T(c,k) at a shared-core rate of 0/50/90 %. Arms A (per-rule pipeline), D0 (one table, no lets), D (one table, lets). Tests: every arm equals the reference evaluator (bags), crepe! and ascent! (sets), at 0, 50, 90 and 100 % shared; the shared core is one let and planes read are pinned; nothing is lifted at 0 %; a stale side is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
The first layout put every side of every rule over the union of all centers. Measured at 200k centers, that made a workload with no shared core slower than the per-rule path (prepare 2.84 s vs 2.09 s, tuples 293 ms vs 145 ms): each side is laid out densely over its table's domain. Layout::Components gives one table per group of rules that share a side, directly or through other rules; a rule that shares nothing keeps a table of its own. Layout::OneTable stays as the measured counter-example (arm U). Tests: every arm under both layouts equals the reference, crepe! and ascent!; at 0 % shared, Components lays out exactly the per-rule rows, one table per rule; at 90 %, one group for core 0 plus one per other rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VncKoyG6JkpsoqhqTGTv3f
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
crepe-plan-probe/src/cse.rs—evaluate_shared. It makes the same rewrites aspipeline::evaluateand gives the same answer. The rules are split into groups. Each group:And(Sym(side));sharingon, turns parts that several rules share into lets (set_program::share) and runs them throughrelalg::run_program(U2).Layout::Components: rules that share a side, directly or through other rules, share one table. A rule that shares nothing keeps its own table.Layout::OneTableputs every rule into one table. It stays in as the measured counter-example.native::tuples_over_mask: the per-rule tuple read, moved out into a helper so the shared tables can use it. Behaviour is unchanged; the existing 41 tests pass.examples/rule_cse.rs: 256 rulesOut(k,x,z) <- R_g(x,c), S_g(c,z), T(c,k), with 0 %, 50 % or 90 % of them using the same core. Four arms:Measured
200,000 centers, release build, median of 3 runs:
Correctness
crepe!andascent!(set semantics) and arm A. Checked at 0, 50, 90 and 100 % shared.entries/2026-10-21-u3-cross-rule-cse.md; added a note to the plan.Open
sharecosts more than it saves when the planes are this small. Two options, neither measured yet: group star rules by identical core keys, or skip lets when a single plane is cheaper than the search.Generated by Claude Code