-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: ignore bus interactions & reduce block machine row range #2322
base: main
Are you sure you want to change the base?
Conversation
Failing, one test, to reproduce: Issue is that it solves for the multiplicity column in the next block, but writing to the next block is not currently supported... |
Cleans up the log a little bit, moving some logs to trace level. Especially related to JIT, which fails quite frequently still. For example, this exposes the issue fixed by #2322: ``` $ RUST_LOG=debug cargo run pil test_data/std/binary_large_test.asm -o output -f --linker-mode bus ... [00:00:00 (ETA: 00:00:00)] ░░░░░░░░░░░░░░░░░░░░ 0% - Starting... Compiling JIT function for Machine: Secondary machine 0: main_binary (BlockMachine) Identity: main::instr_and $ [0, main::X0, main::X1, main::X2] is main_binary::latch * main_binary::sel[0] $ [main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C] Known args: 1110 => Error generating JIT code: Code generation failed: Incomplete machine calls: Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row -1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 0) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 2) ... Compiling JIT function for Machine: Secondary machine 0: main_binary (BlockMachine) Identity: main::instr_or $ [1, main::X0, main::X1, main::X2] is main_binary::latch * main_binary::sel[1] $ [main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C] Known args: 1110 => Error generating JIT code: Code generation failed: Incomplete machine calls: Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row -1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 0) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 2) ... Compiling JIT function for Machine: Secondary machine 0: main_binary (BlockMachine) Identity: main::instr_xor $ [2, main::X0, main::X1, main::X2] is main_binary::latch * main_binary::sel[2] $ [main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C] Known args: 1110 => Error generating JIT code: Code generation failed: Incomplete machine calls: Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row -1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 0) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 1) Constr::PhantomBusInteraction(18446744069414584320 * (main_binary::latch * main_binary::sel[0]), [1, main_binary::operation_id, main_binary::A, main_binary::B, main_binary::C], main_binary::latch); (row 2) ... Found loop with period 1 starting at row 100 101 of 128 rows are used in machine 'Main machine (Dynamic)'. Looping failed. Trying to generate regularly again. (Use RUST_LOG=debug to see whether this happens more often.) 128 / 129 [00:00:00 (ETA: 00:00:00)] ████████████████████ 100% - Starting... Finalizing VM: Main machine (Dynamic) Secondary machine 0: main_binary (BlockMachine): 0 / 18 blocks computed via JIT. 72 of 128 rows are used in machine 'Secondary machine 0: main_binary (BlockMachine)'. == Witgen profile (570 events) 45.5% ( 975.3ms): Secondary machine 0: main_binary (BlockMachine) 44.6% ( 956.3ms): FixedLookup 6.1% ( 131.3ms): multiplicity witgen 3.5% ( 75.7ms): witgen (outer code) 0.2% ( 4.2ms): Main machine (Dynamic) --------------------------- ==> Total: 2.142724334s ``` --------- Co-authored-by: chriseth <[email protected]>
What was the value it tried to write to the next row? |
The multiplicity. There was a constraint like |
63d68f7
to
cb11fb6
Compare
I noticed that JITing never succeeds if we run with
--linker-mode bus
. This PR fixes it, as can be verified by running this with debug log:Doing so, I came across an issue cause by the block machine processor processing rows
-1..(self.block_size + 1)
: It can actually write to the first row of the next block, in which case we panic, because we don't have that row yet. It would also be pretty annoying to need to support that and not needed in practice. But it turns out, this row range was actually more generous that what we use in the run-time solver, see this line! So I'm reducing it in this PR.