-
Notifications
You must be signed in to change notification settings - Fork 250
feat: document trace layout constants using insta snapshots #2351
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
Open
hawkadrian
wants to merge
34
commits into
0xMiden:next
Choose a base branch
from
hawkadrian:feat/document-trace-constants-with-insta
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b5c8cc5
Update Cargo.toml
hawkadrian 1c173c0
Update mod.rs
hawkadrian fde33be
Create tests.rs
hawkadrian bd6b1c6
Create miden_air__trace__tests__ace_chiplet_layout.snap
hawkadrian daf0a38
Create miden_air__trace__tests__all_chiplet_column_ranges.snap
hawkadrian f552176
Create miden_air__trace__tests__aux_trace_layout.snap
hawkadrian 9109d82
Create miden_air__trace__tests__bitwise_chiplet_layout.snap
hawkadrian f859ef6
Create miden_air__trace__tests__decoder_trace_layout.snap
hawkadrian 372ec88
Create miden_air__trace__tests__hasher_chiplet_layout.snap
hawkadrian 293f0ce
Create miden_air__trace__tests__kernel_rom_chiplet_layout.snap
hawkadrian 9f4f5ff
Create miden_air__trace__tests__main_trace_layout.snap
hawkadrian 4b43a92
Create miden_air__trace__tests__memory_chiplet_layout.snap
hawkadrian f963b44
Create miden_air__trace__tests__stack_trace_layout.snap
hawkadrian c04e78a
Update air/src/trace/snapshots/miden_air__trace__tests__all_chiplet_c…
hawkadrian 6ad773f
Update tests.rs
hawkadrian 9dc95fb
Update miden_air__trace__tests__ace_chiplet_layout.snap
hawkadrian 9ad2e77
Update miden_air__trace__tests__all_chiplet_column_ranges.snap
hawkadrian 91ef09d
Update miden_air__trace__tests__decoder_trace_layout.snap
hawkadrian 1df83e7
Update miden_air__trace__tests__hasher_chiplet_layout.snap
hawkadrian bbc13c7
Update miden_air__trace__tests__kernel_rom_chiplet_layout.snap
hawkadrian 9b0ca1b
Update miden_air__trace__tests__memory_chiplet_layout.snap
hawkadrian 9a7ccba
Update tests.rs
hawkadrian 6e258a0
Update mod.rs
hawkadrian 1f0bd35
Update miden_air__trace__tests__main_trace_layout.snap
hawkadrian fdc0c59
Update mod.rs
hawkadrian b8a1739
Create miden_air__trace__tests__range_check_trace_layout.snap
hawkadrian 4c98c29
Update miden_core__mast__node__basic_block_node__tests__batch_ops_1.snap
hawkadrian 2255b85
Update miden_core__mast__node__basic_block_node__tests__batch_ops_2.snap
hawkadrian 551c5bc
Update miden_core__mast__node__basic_block_node__tests__batch_ops_3.snap
hawkadrian 922d164
Update miden_core__mast__node__basic_block_node__tests__batch_ops_5.snap
hawkadrian 5d36e73
Update miden_core__mast__node__basic_block_node__tests__batch_ops_6.snap
hawkadrian 0f2c1e8
Update miden_core__mast__node__basic_block_node__tests__batch_ops_7.snap
hawkadrian bb16254
Update miden_core__mast__node__basic_block_node__tests__batch_ops_8.snap
hawkadrian eea96d4
Update miden_core__mast__node__basic_block_node__tests__batch_ops_9.snap
hawkadrian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
34 changes: 34 additions & 0 deletions
34
air/src/trace/snapshots/miden_air__trace__tests__ace_chiplet_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| ACE CHIPLET LAYOUT | ||
| ===================== | ||
|
|
||
| Chiplet Selectors: | ||
| Number of ACE selectors: 4 | ||
|
|
||
| Column Indices (ordered by index): | ||
| - 0: Selector start | ||
| - 1: Selector block | ||
| - 2: Context | ||
| - 3: Pointer | ||
| - 4: Clock | ||
| - 5: Eval operation | ||
| - 6: ID 0 | ||
| - 7: Value 0_0 | ||
| - 8: Value 0_1 | ||
| - 9: ID 1 | ||
| - 10: Value 1_0 | ||
| - 11: Value 1_1 | ||
| - 12: ID 2 | ||
| - 12: Read num eval | ||
| - 13: Value 2_0 | ||
| - 14: Value 2_1 | ||
| - 14: Multiplicity 1 | ||
| - 15: Multiplicity 0 | ||
|
|
||
| Other Constants: | ||
| Number of columns: 16 | ||
| ACE init label: 8 | ||
| Instruction ID2 offset: 1152921504606846976 |
34 changes: 34 additions & 0 deletions
34
air/src/trace/snapshots/miden_air__trace__tests__all_chiplet_column_ranges.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| ALL CHIPLET COLUMN RANGES | ||
| ================================ | ||
|
|
||
| Chiplet Selector Counts: | ||
| - Hasher selectors: 1 | ||
| - Bitwise selectors: 2 | ||
| - Memory selectors: 3 | ||
| - ACE selectors: 4 | ||
| - Kernel ROM selectors: 5 | ||
|
|
||
| Hasher Chiplet: | ||
| Trace offset: 52 | ||
| Selector range: 52..55 (width 3) | ||
| State range: 55..67 (width 12) | ||
| Capacity range: 55..59 (width 4) | ||
| Rate range: 59..67 (width 8) | ||
| Node index: 67 | ||
|
|
||
| Bitwise Chiplet: | ||
| Trace offset: 53 | ||
| Selector index: 53 | ||
| Input A range: 56..60 (width 4) | ||
| Input B range: 60..64 (width 4) | ||
| Trace range: 53..66 (width 13) | ||
|
|
||
| Memory Chiplet: | ||
| Trace offset: 54 | ||
| Value range: 61..65 (width 4) | ||
|
|
||
| Note: All column indices are relative to the main trace (not relative to the chiplet trace). |
39 changes: 39 additions & 0 deletions
39
air/src/trace/snapshots/miden_air__trace__tests__aux_trace_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| AUXILIARY TRACE LAYOUT | ||
| ========================== | ||
|
|
||
| Decoder Auxiliary Trace: | ||
| Offset: 0 | ||
| Width: 3 | ||
| Range: 0..3 | ||
|
|
||
| Stack Auxiliary Trace: | ||
| Offset: 3 | ||
| Width: 1 | ||
| Range: 3..4 | ||
|
|
||
| Range Check Auxiliary Trace: | ||
| Offset: 4 | ||
| Width: 1 | ||
| Range: 4..5 | ||
|
|
||
| Hasher/Kernel ROM Virtual Table Auxiliary Trace: | ||
| Offset: 5 | ||
| Width: 1 | ||
| Range: 5..6 | ||
|
|
||
| Chiplets Bus Auxiliary Trace: | ||
| Offset: 6 | ||
| Width: 1 | ||
| Range: 6..7 | ||
|
|
||
| ACE Chiplet Wiring Bus: | ||
| Offset: 7 | ||
| Width: 1 | ||
| Range: 7..8 | ||
|
|
||
| Total Auxiliary Trace Width: 8 | ||
| Auxiliary Trace Random Elements: 16 |
30 changes: 30 additions & 0 deletions
30
air/src/trace/snapshots/miden_air__trace__tests__bitwise_chiplet_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| BITWISE CHIPLET LAYOUT | ||
| =========================== | ||
|
|
||
| Chiplet Selectors: | ||
| Number of bitwise selectors: 2 | ||
| Trace offset: 53 | ||
| Selector column index: 53 | ||
|
|
||
| Input Columns: | ||
| Input A column index: 54 | ||
| Input B column index: 55 | ||
| Input A bit decomposition range: 56..60 | ||
| Input B bit decomposition range: 60..64 | ||
|
|
||
| Output Columns: | ||
| Previous output column index: 64 | ||
| Output column index: 65 | ||
|
|
||
| Trace Range: | ||
| Bitwise trace range: 53..66 | ||
|
|
||
| Other Constants: | ||
| Number of selectors: 1 | ||
| Trace width: 13 | ||
| Operation cycle length: 8 | ||
| Number of decomposed bits per row: 4 |
39 changes: 39 additions & 0 deletions
39
air/src/trace/snapshots/miden_air__trace__tests__decoder_trace_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| DECODER TRACE LAYOUT | ||
| ====================== | ||
|
|
||
| Hasher State: | ||
| Offset: 8 | ||
| Number of columns: 8 | ||
| Range: 8..16 | ||
|
|
||
| Operation Bits: | ||
| Offset: 1 | ||
| Number of bits: 7 | ||
| Range: 1..8 | ||
|
|
||
| Operation Bits Extra Columns (for degree reduction): | ||
| Offset: 22 | ||
| Number of columns: 2 | ||
| Range: 22..24 | ||
|
|
||
| User Operation Helpers: | ||
| Offset: 10 | ||
| Number of helpers: 6 | ||
|
|
||
| Operation Batch Flags: | ||
| Offset: 19 | ||
| Number of flags: 3 | ||
| Range: 19..22 | ||
|
|
||
| Column Indices (ordered by index): | ||
| - 12: Is loop body flag | ||
| - 13: Is loop flag | ||
| - 14: Is call flag | ||
| - 15: Is syscall flag | ||
| - 16: In span column | ||
| - 17: Group count column | ||
| - 18: Operation index column |
32 changes: 32 additions & 0 deletions
32
air/src/trace/snapshots/miden_air__trace__tests__hasher_chiplet_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| HASHER CHIPLET LAYOUT | ||
| ========================== | ||
|
|
||
| Chiplet Selectors: | ||
| Number of hasher selectors: 1 | ||
| Trace offset: 52 | ||
| Selector column range: 52..55 | ||
|
|
||
| Hasher State: | ||
| State width: 12 | ||
| State column range: 55..67 | ||
|
|
||
| Capacity Portion (RPO): | ||
| Capacity length: 4 | ||
| Capacity column range: 55..59 | ||
| Capacity domain index: 1 | ||
|
|
||
| Rate Portion (RPO): | ||
| Rate length: 8 | ||
| Rate column range: 59..67 | ||
|
|
||
| Other Constants: | ||
| Digest length: 4 | ||
| Number of rounds: 7 | ||
| Hash cycle length: 8 | ||
| Number of selectors: 3 | ||
| Hasher trace width: 16 | ||
| Node index column: 67 |
14 changes: 14 additions & 0 deletions
14
air/src/trace/snapshots/miden_air__trace__tests__kernel_rom_chiplet_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| KERNEL ROM CHIPLET LAYOUT | ||
| ================================ | ||
|
|
||
| Chiplet Selectors: | ||
| Number of kernel ROM selectors: 5 | ||
|
|
||
| Other Constants: | ||
| Trace width: 5 | ||
| Kernel procedure call label: 0b001111 + 1 (16) | ||
| Kernel procedure init label: 0b101111 + 1 (48) |
40 changes: 40 additions & 0 deletions
40
air/src/trace/snapshots/miden_air__trace__tests__main_trace_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| MAIN TRACE LAYOUT | ||
| =================== | ||
|
|
||
| Minimum trace length: 2048 | ||
|
|
||
| System Trace: | ||
| Offset: 0 | ||
| Width: 6 | ||
| Range: 0..6 | ||
| - Clock column index: 0 | ||
| - Context column index: 1 | ||
| - Function hash offset: 2 | ||
| - Function hash range: 2..6 | ||
|
|
||
| Decoder Trace: | ||
| Offset: 6 | ||
| Width: 24 | ||
| Range: 6..30 | ||
|
|
||
| Stack Trace: | ||
| Offset: 30 | ||
| Width: 19 | ||
| Range: 30..49 | ||
|
|
||
| Range Check Trace: | ||
| Offset: 49 | ||
| Width: 2 | ||
| Range: 49..51 | ||
|
|
||
| Chiplets Trace: | ||
| Offset: 51 | ||
| Width: 20 | ||
| Range: 51..71 | ||
|
|
||
| Total Trace Width: 71 | ||
| Padded Trace Width: 72 |
25 changes: 25 additions & 0 deletions
25
air/src/trace/snapshots/miden_air__trace__tests__memory_chiplet_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| MEMORY CHIPLET LAYOUT | ||
| ========================== | ||
|
|
||
| Chiplet Selectors: | ||
| Number of memory selectors: 3 | ||
| Trace offset: 54 | ||
| Trace width: 15 | ||
|
|
||
| Column Indices (ordered by index): | ||
| - 54: Is read column | ||
| - 55: Is word access column | ||
| - 56: Context column | ||
| - 57: Word column | ||
| - 58: Index 0 column | ||
| - 59: Index 1 column | ||
| - 60: Clock column | ||
| - 61..65: Value columns | ||
| - 65: Delta 0 column | ||
| - 66: Delta 1 column | ||
| - 67: Delta inverse column | ||
| - 68: Same context and word flag | ||
19 changes: 19 additions & 0 deletions
19
air/src/trace/snapshots/miden_air__trace__tests__range_check_trace_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| RANGE CHECK TRACE LAYOUT | ||
| ============================ | ||
|
|
||
| Main Trace: | ||
| Offset: 49 | ||
| Width: 2 | ||
| Range: 49..51 | ||
| - M column (multiplicity): 49 | ||
| - V column (values being range-checked): 50 | ||
|
|
||
| Auxiliary Trace: | ||
| Offset: 4 | ||
| Width: 1 | ||
| Range: 4..5 | ||
| - B column (running product): 4 |
15 changes: 15 additions & 0 deletions
15
air/src/trace/snapshots/miden_air__trace__tests__stack_trace_layout.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| source: air/src/trace/tests.rs | ||
| expression: layout | ||
| --- | ||
| STACK TRACE LAYOUT | ||
| ==================== | ||
|
|
||
| Stack Top: | ||
| Offset: 0 | ||
|
|
||
| Helper Columns: | ||
| Number of helper columns: 3 | ||
| - b0 column (stack depth): 16 | ||
| - b1 column (overflow table address): 17 | ||
| - h0 column (1 / (b0 - 16)): 18 |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move up to first section