test(avm): integration test for alu truncation#22684
Conversation
e3b735a to
47449c2
Compare
IlyasRidhuan
left a comment
There was a problem hiding this comment.
Looks good (modulo us figuring out what to do with tests that rely on TS opcodes folder)
47449c2 to
aecebcf
Compare
dbanks12
left a comment
There was a problem hiding this comment.
LGTM, but just want to better understand exactly what each test is testing.
| // Exercise SET truncation: set values whose widths exceed the target tag and | ||
| // rely on `buildFromTagTruncating` to truncate to the low bits of the tag. | ||
| // Covers sources larger than 128 bits (via SET_FF) and sources in (32, 128] | ||
| // bits (via SET_64) against destination tags U1/U8/U16/U32/U64/U128. | ||
| export async function setTruncationTest(tester: PublicTxSimulationTester) { | ||
| // 200-bit value: forces truncation for every target tag up to U128. |
There was a problem hiding this comment.
What exactly is this testing? The AVM? Or buildFromTagTruncating in TS?
There was a problem hiding this comment.
The goal is to test the AVM circuit as a whole in the presence of truncation performed by CAST and or SET. The rationale about adding this test is a recent change which removed the possibility to pass larger values than their type in the bulk test. To still keep the same testing coverage, I opened a ticket which resulted into the present PR. I made it a bit more exhaustive by testing more target types and covering both SET and CAST.
aecebcf to
2f6cf75
Compare
2f6cf75 to
9344d19
Compare
Linear issue: AVM-267