Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8a72058
chore: add test for std refcell
Stevengre Oct 29, 2025
9f82eec
chore: add simple test for one struct casting
Stevengre Oct 30, 2025
c2d6862
chore: update state without thunk and any modification
Stevengre Oct 30, 2025
28cf9d5
feat: support UnsafeCell cast to Int
Stevengre Oct 30, 2025
93cad6f
chore: new passed prove-rs/local-raw-fail.rs test
Stevengre Oct 30, 2025
fa24d9b
fix: closure_access_struct failure
Stevengre Oct 30, 2025
ede664c
chore: make format
Stevengre Oct 30, 2025
55237eb
chore: remove passed test expected
Stevengre Oct 30, 2025
21f5034
chore: update expected state
Stevengre Oct 30, 2025
537b584
chore: update test pass status
Stevengre Oct 30, 2025
c525218
chore: update test pass status
Stevengre Oct 30, 2025
f270fe8
chore: add more test for the semantics
Stevengre Oct 31, 2025
c25f259
chore: update test_integration.py
Stevengre Oct 31, 2025
2093f58
feat: support reverse transparent struct cast
Stevengre Nov 1, 2025
a313ead
feat: refine transparent alignment handling
Stevengre Nov 3, 2025
1057a44
update expected output
Stevengre Nov 3, 2025
d3d93ca
feat: solve interior-mut3-fail.rs
Stevengre Nov 4, 2025
8d95126
feat: provide more information for functions without body
Stevengre Nov 4, 2025
46e791a
feat(not-ready)
Stevengre Nov 4, 2025
4b3ba64
chore: interior-mut shouldn't fail with this pr
Stevengre Nov 4, 2025
e319042
chore: add comments
Stevengre Nov 4, 2025
96dc111
feat: support ZSTs
Stevengre Nov 4, 2025
e4b482c
chore: interior-mut3 should pass
Stevengre Nov 5, 2025
430dd93
fix: adjust stack projection writes
Stevengre Nov 5, 2025
6cb7e3f
feat: support cast from bytes to int
Stevengre Nov 5, 2025
e5f30b7
feat: support ref borrow (need to optimize)
Stevengre Nov 5, 2025
0a78bae
feat: support cast from int to bytes
Stevengre Nov 5, 2025
d0c1793
restore stable-mir-json
Stevengre Nov 5, 2025
08389d0
chore: format
Stevengre Nov 5, 2025
2e1aeb1
feat: add #withPointerOffset to support projections' pointer offset
Stevengre Nov 5, 2025
1b24944
feat: enhance interior mutability handling in projections
Stevengre Nov 5, 2025
5ca54b5
refactor: remove unused NormalSym population logic in _functions
Stevengre Nov 5, 2025
4683341
feat: simplify borrow cell increment and decrement logic for interior…
Stevengre Nov 5, 2025
a8b3258
feat: add handling for pointer realignment across transparent wrapper…
Stevengre Nov 5, 2025
f1c3005
feat: initialize zero-sized locals for borrowing to ensure projection…
Stevengre Nov 5, 2025
d94197b
feat: streamline alignment rule for struct types in #alignOf function
Stevengre Nov 5, 2025
d45a24a
feat: update expected output for pointer cast length test and symboli…
Stevengre Nov 5, 2025
69a4efd
feat: add comment for pointer transmutation test and correctness check
Stevengre Nov 5, 2025
eb83742
feat: add static array checks for transmute operations in MIR execution
Stevengre Nov 5, 2025
b13b312
feat: refactor type identification for Ref and RefMut in type metadata
Stevengre Nov 5, 2025
d3b81e1
feat: update expected step count in crate2::test_crate1_with test
Stevengre Nov 5, 2025
716dc16
feat: refine drop semantics and enhance comments for clarity
Stevengre Nov 5, 2025
3450bc8
feat: enhance Drop terminator documentation and clarify borrow-aware …
Stevengre Nov 5, 2025
1efd5f7
feat: update expected step count in crate2::main.expected test
Stevengre Nov 5, 2025
cd57064
feat: enhance drop semantics to support general drops and improve bor…
Stevengre Nov 6, 2025
0a16989
feat: enhance borrow reference handling and clarify aggregate process…
Stevengre Nov 6, 2025
0b07a30
Update kmir/src/kmir/kdist/mir-semantics/kmir.md
Stevengre Nov 6, 2025
d57f4f3
Update kmir/src/kmir/kdist/mir-semantics/kmir.md
Stevengre Nov 6, 2025
541edd4
feat: update expected step count in crate2::test_crate1_with.expected
Stevengre Nov 6, 2025
193bef5
chore: update expected output
Stevengre Nov 6, 2025
8358db0
test: ensure interior mut refcell updates mint and account data
Stevengre Nov 6, 2025
3b3ef6a
docs(rt): Clarify zero sized type limitations
Stevengre Nov 6, 2025
9cc3eaf
moved to "jh/int-bytes-cast"
Stevengre Nov 6, 2025
8a77758
move to `jh/correct-offset`
Stevengre Nov 6, 2025
8e75511
moved to `jh/zero-sized`
Stevengre Nov 6, 2025
4f9fcd9
moved to `jh/interior-mut`
Stevengre Nov 6, 2025
83c924c
moved to `jh/zero-sized`
Stevengre Nov 6, 2025
54ceab5
chore: make ci fail faster
Stevengre Nov 7, 2025
00e2df2
chore: moved to jh/align-transparent-place
Stevengre Nov 7, 2025
55f9281
chore: moved to jh/pointer2int
Stevengre Nov 7, 2025
5c6128e
chore: moved to jh/delete-doc
Stevengre Nov 7, 2025
61c8c69
chore: remove empty lines
Stevengre Nov 7, 2025
8cc88c4
chore: move to jh/align-transparent-place
Stevengre Nov 7, 2025
82392e7
chore: move to jh/align-transparent-place
Stevengre Nov 7, 2025
cca1452
chore: move to jh/align-transparent-place
Stevengre Nov 7, 2025
76a081e
chore: move to jh/zero-sized-decode
Stevengre Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion kmir/src/kmir/kdist/mir-semantics/rt/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ A variant `#forceSetLocal` is provided for setting the local value without check
</locals>
requires 0 <=Int I andBool I <Int size(LOCALS)
andBool isTypedValue(LOCALS[I])
andBool mutabilityOf(getLocal(LOCALS, I)) ==K mutabilityMut
andBool (mutabilityOf(getLocal(LOCALS, I)) ==K mutabilityMut
orBool #allowsInteriorMutation(lookupTy(tyOfLocal(getLocal(LOCALS, I)))))
[preserves-definedness] // valid list indexing checked

rule <k> #setLocalValue(place(local(I), .ProjectionElems), VAL) => .K ... </k>
Expand Down
9 changes: 9 additions & 0 deletions kmir/src/kmir/kdist/mir-semantics/rt/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ requires "value.md"
module RT-TYPES
imports BOOL
imports INT
imports STRING
imports MAP
imports K-EQUAL

Expand Down Expand Up @@ -90,6 +91,14 @@ Pointers to arrays/slices are compatible with pointers to the element type

rule #structOffsets(someLayoutShape(layoutShape(fieldsShapeArbitrary(mk(OFFSETS)), _, _, _, _))) => OFFSETS
rule #structOffsets(_) => .MachineSizes [owise]

syntax Bool ::= #allowsInteriorMutation(TypeInfo) [function, total]

rule #allowsInteriorMutation(typeInfoStructType(mirString(NAME), _, _, _))
=> findString(NAME, "UnsafeCell", 0) =/=Int -1
rule #allowsInteriorMutation(typeInfoStructType(NAME:String, _, _, _))
=> findString(NAME, "UnsafeCell", 0) =/=Int -1
rule #allowsInteriorMutation(_) => false [owise]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is String matching the best way to do this? It genuinely might be but I feel suspicious of this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for calling this out. But I don't know if there any other stable way to find this function rather than String. adtDef is not open and stable to use, I think.

```

## Determining types of places with projection
Expand Down
1 change: 0 additions & 1 deletion kmir/src/tests/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
}
PROVE_RS_SHOW_SPECS = [
'interior-mut-fail',
'interior-mut3-fail',
'interior-mut-refcell-fail',
'assert_eq_exp',
'bitwise-not-shift',
Expand Down