SSA interpreter should work on programs generated by the pipeline.
❯ NOIR_ARBTEST_SEED=0xf1db737f00009501 cargo test -q -p noir_ast_fuzzer_fuzz pass_vs_prev
running 1 test
targets::pass_vs_prev::tests::fuzz_with_arbtest --- FAILED
failures:
---- targets::pass_vs_prev::tests::fuzz_with_arbtest stdout ----
---
Comparison failed:
both programs failed: Expected Field value in call to to_bits but instead found `v340 = u8 0` vs Expected Field value in call to to_bits but instead found `v340 = u8 0`
Internal(TypeError { value_id: Id(340), value: "u8 0", expected_type: "Field", instruction: "call to to_bits" })
Internal(TypeError { value_id: Id(340), value: "u8 0", expected_type: "Field", instruction: "call to to_bits" })
---
AST:
global G_A: [i16; 0] = [];
fn main(a: u8) -> pub u8 {
(((a as u32) << (123 >> a)) as u8)
}
---
ABI Inputs:
a = "0x00000000000000000000000000000000000000000000000000000000000000ea"
---
SSA Inputs:
0: u8 234
---
Options:
CompareOptions { inliner_aggressiveness: -9223372036854775808 }
---
SSA 1 after step 38 (Dead Instruction Elimination):
g0 = make_array [] : [i16; 0]
acir(inline) predicate_pure fn main f0 {
b0(v2: u8):
v338 = lt v2, u8 8
v339 = cast v338 as u8
v340 = unchecked_mul v339, v2
v341 = call to_le_bits(v340) -> [u1; 8]
v342 = array_get v341, index Field 7 -> u1
v343 = not v342
v344 = cast v342 as Field
v345 = cast v343 as Field
v346 = mul Field 2, v344
v347 = add v346, v345
v348 = mul v347, v347
v349 = mul v348, Field 2
v350 = array_get v341, index Field 6 -> u1
v351 = not v350
v352 = cast v350 as Field
v353 = cast v351 as Field
v354 = mul v349, v352
v355 = mul v348, v353
v356 = add v354, v355
v357 = mul v356, v356
v358 = mul v357, Field 2
v359 = array_get v341, index Field 5 -> u1
v360 = not v359
v361 = cast v359 as Field
v362 = cast v360 as Field
v363 = mul v358, v361
v364 = mul v357, v362
v365 = add v363, v364
v366 = mul v365, v365
v367 = mul v366, Field 2
v368 = array_get v341, index Field 4 -> u1
v369 = not v368
v370 = cast v368 as Field
v371 = cast v369 as Field
v372 = mul v367, v370
v373 = mul v366, v371
v374 = add v372, v373
v375 = mul v374, v374
v376 = mul v375, Field 2
v377 = array_get v341, index Field 3 -> u1
v378 = not v377
v379 = cast v377 as Field
v380 = cast v378 as Field
v381 = mul v376, v379
v382 = mul v375, v380
v383 = add v381, v382
v384 = mul v383, v383
v385 = mul v384, Field 2
v386 = array_get v341, index Field 2 -> u1
v387 = not v386
v388 = cast v386 as Field
v389 = cast v387 as Field
v390 = mul v385, v388
v391 = mul v384, v389
v392 = add v390, v391
v393 = mul v392, v392
v394 = mul v393, Field 2
v395 = array_get v341, index Field 1 -> u1
v396 = not v395
v397 = cast v395 as Field
v398 = cast v396 as Field
v399 = mul v394, v397
v400 = mul v393, v398
v401 = add v399, v400
v402 = mul v401, v401
v403 = mul v402, Field 2
v404 = array_get v341, index Field 0 -> u1
v405 = not v404
v406 = cast v404 as Field
v407 = cast v405 as Field
v408 = mul v403, v406
v409 = mul v402, v407
v410 = add v408, v409
v411 = cast v410 as u8
v412 = div u8 123, v411
v413 = unchecked_mul v339, v412
v414 = lt v413, u8 32
v415 = cast v414 as u32
v416 = call to_le_bits(v413) -> [u1; 8]
v417 = array_get v416, index Field 7 -> u1
v418 = not v417
v419 = cast v417 as Field
v420 = cast v418 as Field
v421 = mul Field 2, v419
v422 = add v421, v420
v423 = mul v422, v422
v424 = mul v423, Field 2
v425 = array_get v416, index Field 6 -> u1
v426 = not v425
v427 = cast v425 as Field
v428 = cast v426 as Field
v429 = mul v424, v427
v430 = mul v423, v428
v431 = add v429, v430
v432 = mul v431, v431
v433 = mul v432, Field 2
v434 = array_get v416, index Field 5 -> u1
v435 = not v434
v436 = cast v434 as Field
v437 = cast v435 as Field
v438 = mul v433, v436
v439 = mul v432, v437
v440 = add v438, v439
v441 = mul v440, v440
v442 = mul v441, Field 2
v443 = array_get v416, index Field 4 -> u1
v444 = not v443
v445 = cast v443 as Field
v446 = cast v444 as Field
v447 = mul v442, v445
v448 = mul v441, v446
v449 = add v447, v448
v450 = mul v449, v449
v451 = mul v450, Field 2
v452 = array_get v416, index Field 3 -> u1
v453 = not v452
v454 = cast v452 as Field
v455 = cast v453 as Field
v456 = mul v451, v454
v457 = mul v450, v455
v458 = add v456, v457
v459 = mul v458, v458
v460 = mul v459, Field 2
v461 = array_get v416, index Field 2 -> u1
v462 = not v461
v463 = cast v461 as Field
v464 = cast v462 as Field
v465 = mul v460, v463
v466 = mul v459, v464
v467 = add v465, v466
v468 = mul v467, v467
v469 = mul v468, Field 2
v470 = array_get v416, index Field 1 -> u1
v471 = not v470
v472 = cast v470 as Field
v473 = cast v471 as Field
v474 = mul v469, v472
v475 = mul v468, v473
v476 = add v474, v475
v477 = mul v476, v476
v478 = mul v477, Field 2
v479 = array_get v416, index Field 0 -> u1
v480 = not v479
v481 = cast v479 as Field
v482 = cast v480 as Field
v483 = mul v478, v481
v484 = mul v477, v482
v485 = add v483, v484
v486 = cast v485 as u32
v487 = unchecked_mul v415, v486
v488 = cast v2 as Field
v489 = cast v487 as Field
v490 = mul v488, v489
v491 = truncate v490 to 32 bits, max_bit_size: 254
v492 = cast v491 as u32
constrain v414 == u1 1, "attempt to bit-shift with overflow"
v493 = truncate v492 to 8 bits, max_bit_size: 32
v494 = cast v493 as u8
return v494
}
---
SSA 2 after step 39 (Removing Unreachable Functions):
g0 = make_array [] : [i16; 0]
acir(inline) predicate_pure fn main f0 {
b0(v2: u8):
v338 = lt v2, u8 8
v339 = cast v338 as u8
v340 = unchecked_mul v339, v2
v341 = call to_le_bits(v340) -> [u1; 8]
v342 = array_get v341, index Field 7 -> u1
v343 = not v342
v344 = cast v342 as Field
v345 = cast v343 as Field
v346 = mul Field 2, v344
v347 = add v346, v345
v348 = mul v347, v347
v349 = mul v348, Field 2
v350 = array_get v341, index Field 6 -> u1
v351 = not v350
v352 = cast v350 as Field
v353 = cast v351 as Field
v354 = mul v349, v352
v355 = mul v348, v353
v356 = add v354, v355
v357 = mul v356, v356
v358 = mul v357, Field 2
v359 = array_get v341, index Field 5 -> u1
v360 = not v359
v361 = cast v359 as Field
v362 = cast v360 as Field
v363 = mul v358, v361
v364 = mul v357, v362
v365 = add v363, v364
v366 = mul v365, v365
v367 = mul v366, Field 2
v368 = array_get v341, index Field 4 -> u1
v369 = not v368
v370 = cast v368 as Field
v371 = cast v369 as Field
v372 = mul v367, v370
v373 = mul v366, v371
v374 = add v372, v373
v375 = mul v374, v374
v376 = mul v375, Field 2
v377 = array_get v341, index Field 3 -> u1
v378 = not v377
v379 = cast v377 as Field
v380 = cast v378 as Field
v381 = mul v376, v379
v382 = mul v375, v380
v383 = add v381, v382
v384 = mul v383, v383
v385 = mul v384, Field 2
v386 = array_get v341, index Field 2 -> u1
v387 = not v386
v388 = cast v386 as Field
v389 = cast v387 as Field
v390 = mul v385, v388
v391 = mul v384, v389
v392 = add v390, v391
v393 = mul v392, v392
v394 = mul v393, Field 2
v395 = array_get v341, index Field 1 -> u1
v396 = not v395
v397 = cast v395 as Field
v398 = cast v396 as Field
v399 = mul v394, v397
v400 = mul v393, v398
v401 = add v399, v400
v402 = mul v401, v401
v403 = mul v402, Field 2
v404 = array_get v341, index Field 0 -> u1
v405 = not v404
v406 = cast v404 as Field
v407 = cast v405 as Field
v408 = mul v403, v406
v409 = mul v402, v407
v410 = add v408, v409
v411 = cast v410 as u8
v412 = div u8 123, v411
v413 = unchecked_mul v339, v412
v414 = lt v413, u8 32
v415 = cast v414 as u32
v416 = call to_le_bits(v413) -> [u1; 8]
v417 = array_get v416, index Field 7 -> u1
v418 = not v417
v419 = cast v417 as Field
v420 = cast v418 as Field
v421 = mul Field 2, v419
v422 = add v421, v420
v423 = mul v422, v422
v424 = mul v423, Field 2
v425 = array_get v416, index Field 6 -> u1
v426 = not v425
v427 = cast v425 as Field
v428 = cast v426 as Field
v429 = mul v424, v427
v430 = mul v423, v428
v431 = add v429, v430
v432 = mul v431, v431
v433 = mul v432, Field 2
v434 = array_get v416, index Field 5 -> u1
v435 = not v434
v436 = cast v434 as Field
v437 = cast v435 as Field
v438 = mul v433, v436
v439 = mul v432, v437
v440 = add v438, v439
v441 = mul v440, v440
v442 = mul v441, Field 2
v443 = array_get v416, index Field 4 -> u1
v444 = not v443
v445 = cast v443 as Field
v446 = cast v444 as Field
v447 = mul v442, v445
v448 = mul v441, v446
v449 = add v447, v448
v450 = mul v449, v449
v451 = mul v450, Field 2
v452 = array_get v416, index Field 3 -> u1
v453 = not v452
v454 = cast v452 as Field
v455 = cast v453 as Field
v456 = mul v451, v454
v457 = mul v450, v455
v458 = add v456, v457
v459 = mul v458, v458
v460 = mul v459, Field 2
v461 = array_get v416, index Field 2 -> u1
v462 = not v461
v463 = cast v461 as Field
v464 = cast v462 as Field
v465 = mul v460, v463
v466 = mul v459, v464
v467 = add v465, v466
v468 = mul v467, v467
v469 = mul v468, Field 2
v470 = array_get v416, index Field 1 -> u1
v471 = not v470
v472 = cast v470 as Field
v473 = cast v471 as Field
v474 = mul v469, v472
v475 = mul v468, v473
v476 = add v474, v475
v477 = mul v476, v476
v478 = mul v477, Field 2
v479 = array_get v416, index Field 0 -> u1
v480 = not v479
v481 = cast v479 as Field
v482 = cast v480 as Field
v483 = mul v478, v481
v484 = mul v477, v482
v485 = add v483, v484
v486 = cast v485 as u32
v487 = unchecked_mul v415, v486
v488 = cast v2 as Field
v489 = cast v487 as Field
v490 = mul v488, v489
v491 = truncate v490 to 32 bits, max_bit_size: 254
v492 = cast v491 as u32
constrain v414 == u1 1, "attempt to bit-shift with overflow"
v493 = truncate v492 to 8 bits, max_bit_size: 32
v494 = cast v493 as u8
return v494
}
thread 'targets::pass_vs_prev::tests::fuzz_with_arbtest' panicked at tooling/ast_fuzzer/fuzz/src/targets/mod.rs:48:18:
called `Result::unwrap()` on an `Err` value: both programs failed: Expected Field value in call to to_bits but instead found `v340 = u8 0` vs Expected Field value in call to to_bits but instead found `v340 = u8 0`
Internal(TypeError { value_id: Id(340), value: "u8 0", expected_type: "Field", instruction: "call to to_bits" })
Internal(TypeError { value_id: Id(340), value: "u8 0", expected_type: "Field", instruction: "call to to_bits" })
Location:
/Users/aakoshh/Work/aztec/noir/tooling/ast_fuzzer/src/compare/mod.rs:109:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
arbtest failed!
Seed: 0xf1db737f00009501
failures:
targets::pass_vs_prev::tests::fuzz_with_arbtest
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 4 filtered out; finished in 0.00s
error: test failed, to rerun pass `-p noir_ast_fuzzer_fuzz --lib`
See above.
nargo version = 1.0.0-beta.5 noirc version = 1.0.0-beta.5+c233781fc1fc6124c6047f30144f74c471eb2dc2 (git version hash: b354cea, is dirty: true)
Aim
Discovered testing #8436 after removing the restriction on the first 3 passes.
Expected Behavior
SSA interpreter should work on programs generated by the pipeline.
Bug
To Reproduce
See above.
Change
pass_vs_prevlike so:Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
nargo version = 1.0.0-beta.5 noirc version = 1.0.0-beta.5+c233781fc1fc6124c6047f30144f74c471eb2dc2 (git version hash: b354cea, is dirty: true)
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response