perf: Add MergeOrdered IR node with proper sim interleaving hooks#2828
Open
Benjscho wants to merge 3 commits intohydro-project:mainfrom
Open
perf: Add MergeOrdered IR node with proper sim interleaving hooks#2828Benjscho wants to merge 3 commits intohydro-project:mainfrom
Benjscho wants to merge 3 commits intohydro-project:mainfrom
Conversation
0ced1e2 to
2f1cd7c
Compare
Addresses hydro-project#2768 Replace the sliced!-based merge_ordered implementation with a dedicated HydroNode::MergeOrdered IR node that has distinct codegen for production and simulation. Production codegen: - Emits union() DFIR operator (both inputs pulled in same stratum) Simulation codegen (two modes): - Bounded/tick: MergeOrderedHook (inline) buffers both batches and generates a valid interleaving via boolean coin flips, preserving per-input order. Explores C(a+b, a) states instead of (a+b)!. - Unbounded/top-level: TopLevelMergeOrderedHook releases one element at a time from the front of either input queue, allowing feedback cycles to deliver elements between releases. API changes: - Removed NoTick bound from merge_ordered — works on any Location and Boundedness now. When bounded, the nondet is still explored in sim. - State space reduced from 26 to 6 instances in the existing test (2 elements per input: C(4,2) = 6 valid interleavings). Tests added: - sim_merge_ordered: ordering preservation assertion (invalid interleavings like [2,1,3,4] are never produced) - sim_merge_ordered_one_empty: pass-through when one input is empty - sim_merge_ordered_cycle_back: feedback cycle where a cycled-back element arrives before elements on the other input - sim_merge_ordered_delayed: delayed element on one input - deploy_merge_ordered_delayed: production localhost test with timing
2f1cd7c to
d1316fc
Compare
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.
Addresses #2768
Replace the sliced!-based merge_ordered implementation with a dedicated HydroNode::MergeOrdered IR node that has distinct codegen for production and simulation.
Production codegen:
Simulation codegen (two modes):
API changes:
Tests added: