-
Notifications
You must be signed in to change notification settings - Fork 84
MIR: relax requirement that slice backing allocations must be the same size when applying overrides #3070
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
Draft
chathhorn-galois
wants to merge
7
commits into
master
Choose a base branch
from
chathhorn/issue2620
base: master
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.
Draft
MIR: relax requirement that slice backing allocations must be the same size when applying overrides #3070
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e528298
intTests: add some missing .gitignores.
chathhorn-galois 3ac148a
MIR: don't require slice backing allocs to be equal size when matchin…
chathhorn-galois b17c110
intTests: add missing Makefiles.
chathhorn-galois 62c9b76
Mir override matching: fix issue with slices.
chathhorn-galois 1d06288
Mir override matching: another slices test.
chathhorn-galois 7272e25
Mir override matching: fix issue with offsets.
chathhorn-galois 585b0ec
Mir override matching: fix MirSetupSliceRange case
chathhorn-galois 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| all: ; | ||
| clean: | ||
| sh ./test.sh clean | ||
|
|
||
| .PHONY: all clean |
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,3 @@ | ||
| *.rawlog | ||
| *.log | ||
| *.diff | ||
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,5 @@ | ||
| all: ; | ||
| clean: | ||
| sh ./test.sh clean | ||
|
|
||
| .PHONY: all clean |
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,2 @@ | ||
| libtest.rlib | ||
| libtest.mir |
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,2 @@ | ||
| MIR_SRCS=test | ||
| include ../support/mir-blobs.mk |
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
| versions | ||
| rustc 1.91.0-nightly (02c7b1a7a 2025-09-13) | ||
| mir-json 0.1.0 (JSON schema version 9) | ||
| Rust toolchain nightly-2025-09-14 | ||
| mir-json mtime: Mar 23 11:35:42 2026 | ||
| mir-json version from cargo: mir-json v0.1.0 | ||
| probable mir-json commit: 71700ee8a69e1b7d84f4eed7cbd43373b29d4373 from Tue Mar 17 13:41:39 2026 and/or Tue Mar 17 13:41:39 2026 | ||
| versions-notes | ||
| Generated by update-from.sh version 1 |
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,36 @@ | ||
| fn f(_: &[u8]) {} | ||
|
|
||
| pub fn g(a: [u8; 2]) { | ||
| f(&a) | ||
| } | ||
|
|
||
| pub fn h(a: [u8; 5]) { | ||
| f(&a[0..2]) | ||
| } | ||
|
|
||
| pub fn i(a: [u8; 5]) { | ||
| f(&a[3..5]) | ||
| } | ||
|
|
||
| fn f_u32(_: &[u32]) {} | ||
|
|
||
| pub fn h_u32(a: [u32; 5]) { | ||
| f_u32(&a[0..2]) | ||
| } | ||
|
|
||
| // PRECONDITION: `a` must have at least two elements. | ||
| fn tup(a: &[u8]) -> (u8, u8) { | ||
| (a[0], a[1]) | ||
| } | ||
|
|
||
| pub fn g1(a: [u8; 5]) -> (u8, u8) { | ||
| tup(&a[0..2]) | ||
| } | ||
|
|
||
| pub fn g2(a: [u8; 5]) -> (u8, u8) { | ||
| tup(&a) | ||
| } | ||
|
|
||
| pub fn g3(a: [u8; 5]) -> (u8, u8) { | ||
| tup(&a[1..3]) | ||
| } |
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,76 @@ | ||
| enable_experimental; | ||
|
|
||
| let f_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 2 mir_u8); | ||
| a_ref <- mir_ref_of (mir_term a_array); | ||
| mir_execute_func [mir_slice_value a_ref]; | ||
| }; | ||
|
|
||
| let f_spec_len3 = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 3 mir_u8); | ||
| a_ref <- mir_ref_of (mir_term a_array); | ||
| mir_execute_func [mir_slice_value a_ref]; | ||
| }; | ||
|
|
||
| let g_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 2 mir_u8); | ||
| mir_execute_func [mir_term a_array]; | ||
| }; | ||
|
|
||
| let h_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 5 mir_u8); | ||
| mir_execute_func [mir_term a_array]; | ||
| }; | ||
|
|
||
| let i_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 5 mir_u8); | ||
| mir_execute_func [mir_term a_array]; | ||
| }; | ||
|
|
||
| let f_u32_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 2 mir_u32); | ||
| a_ref <- mir_ref_of (mir_term a_array); | ||
| mir_execute_func [mir_slice_value a_ref]; | ||
| }; | ||
|
|
||
| let h_u32_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 5 mir_u32); | ||
| mir_execute_func [mir_term a_array]; | ||
| }; | ||
|
|
||
| m <- mir_load_module "test.linked-mir.json"; | ||
|
|
||
| f_ov <- mir_verify m "test::f" [] false f_spec z3; | ||
| mir_verify m "test::g" [f_ov] false g_spec z3; | ||
| mir_verify m "test::h" [f_ov] false h_spec z3; | ||
| mir_verify m "test::i" [f_ov] false i_spec z3; | ||
| f_u32_ov <- mir_verify m "test::f_u32" [] false f_u32_spec z3; | ||
| mir_verify m "test::h_u32" [f_u32_ov] false h_u32_spec z3; | ||
| f_ov_len3 <- mir_verify m "test::f" [] false f_spec_len3 z3; | ||
| fails (mir_verify m "test::h" [f_ov_len3] false h_spec z3); | ||
|
|
||
| let tup_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 2 mir_u8); | ||
| a_ref <- mir_ref_of (mir_term a_array); | ||
| mir_execute_func [mir_slice_value a_ref]; | ||
| mir_return (mir_term {{ (a_array @ 0, a_array @ 1) }}); | ||
| }; | ||
|
|
||
| let g1_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 5 mir_u8); | ||
| mir_execute_func [mir_term a_array]; | ||
| mir_return (mir_term {{ (a_array @ 0, a_array @ 1) }}); | ||
| }; | ||
|
|
||
| let g3_spec = do { | ||
| a_array <- mir_fresh_var "a_array" (mir_array 5 mir_u8); | ||
| mir_execute_func [mir_term a_array]; | ||
| mir_return (mir_term {{ (a_array @ 1, a_array @ 2) }}); | ||
| }; | ||
|
|
||
| tup_ov <- mir_verify m "test::tup" [] false tup_spec z3; | ||
| mir_verify m "test::g1" [tup_ov] false g1_spec z3; | ||
| mir_verify m "test::g2" [tup_ov] false g1_spec z3; | ||
|
|
||
| mir_verify m "test::g3" [tup_ov] false g3_spec z3; | ||
| fails (mir_verify m "test::g3" [tup_ov] false g1_spec z3); |
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,3 @@ | ||
| #!/bin/sh | ||
| SAW=${SAW:-saw} | ||
| ${SAW} test.saw |
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,3 @@ | ||
| *.rawlog | ||
| *.log | ||
| *.diff |
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,5 @@ | ||
| all: ; | ||
| clean: | ||
| sh ./test.sh clean | ||
|
|
||
| .PHONY: all clean |
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,5 @@ | ||
| all: ; | ||
| clean: | ||
| sh ./test.sh clean | ||
|
|
||
| .PHONY: all clean |
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,5 @@ | ||
| all: ; | ||
| clean: | ||
| sh ./test.sh clean | ||
|
|
||
| .PHONY: all clean |
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,3 @@ | ||
| *.rawlog | ||
| *.log | ||
| *.diff |
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,3 @@ | ||
| *.rawlog | ||
| *.log | ||
| *.diff |
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,2 @@ | ||
| test.ys | ||
| test.log |
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
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.
Uh oh!
There was an error while loading. Please reload this page.