Skip to content

chore: sync feature/p-token with master#1006

Closed
Stevengre wants to merge 6 commits intofeature/p-tokenfrom
master
Closed

chore: sync feature/p-token with master#1006
Stevengre wants to merge 6 commits intofeature/p-tokenfrom
master

Conversation

@Stevengre
Copy link
Copy Markdown
Contributor

@Stevengre Stevengre commented Mar 31, 2026

Summary

  • sync feature/p-token with current master so the symbolic SPL work carries the latest runtime, type, and test updates
  • pull in upstream fixes for zero-sized function decoding, pointer-cast projection confluence, redundant local writeback cleanup, float support, and integration-test CI trimming
  • keep this PR focused on the branch sync itself; conflict resolution and validation live on the branch update

Upstream commits included

Why

feature/p-token has continued to diverge while master picked up runtime and test changes that are relevant to ongoing symbolic SPL work. Merging master forward here reduces duplicated fixes and gives the feature branch the current upstream baseline before more symbolic work lands.

Validation

  • resolve merge conflicts on feature/p-token
  • run targeted local validation for the merged branch
  • rely on branch CI after the updated branch is pushed

dkcumming and others added 6 commits March 20, 2026 05:07
…ng wrappers. (#989)

This is a bit of everything in one go, but what I was trying to do was
isolate the case seen in [this Kompass
test](https://github.com/runtimeverification/kompass/blob/master/src/tests/integration/data/token/spl-token/show/spl_token_domain_data-fail.main.expected)
that was discussed in #987. The `volatile_load` is coming from
`Box::new` which we are not supporting right now as that does heap
allocation.

This PR:
- Adds failing tests for statics (not decoding properly)
- Adds a failing test for `Box::new`
- Supports sound transmutation between transparent wrappers (in
`#[repr(rust)]` case and their wrapped type. Seen as a `thunk` earlier
in the `Box::new` proof and I thought I would solve it now. There are
tests for this changed from failing passing in the commit history.

So the `volatile_load` is expected to fail until we figure out some
support for the things that these tests fail on. This is not blocking
any work now so I think it is fine just to add the failing tests

---------

Co-authored-by: automergerpr-permission-manager[bot] <190534181+automergerpr-permission-manager[bot]@users.noreply.github.com>
## Summary

- Skip LLVM backend `test_exec_smir` tests in CI — keep Haskell only,
since it's the backend used for proving and bugs there have higher
impact
- Skip `test_prove_termination` in CI — the same 19 programs are already
executed via `test_exec_smir[*-haskell]`

This is done via a pytest `-k` filter in the CI workflow only — **no
test code is modified**, so all tests remain available for local
development.

**Deselected: 58 of 247 tests** (39 LLVM exec_smir + 19
prove_termination)

## Risk Analysis

- LLVM backend regression will be missed in the previous test, which
should be handled by future test framework refactoring. But if we don't
add new `exec_smir` test or add new `exec_smir` test with llvm to update
expected files, the result is the same as we run CI before.
- `test_prove_termination` just uses `prove-rs` to validate the
termination, which is the same as the comparison with the current
expected files. I believe that there is no risk to remove them in this
way.

## Expected CI time reduction

~2h37m → ~1h20m (based on [this
run](https://github.com/runtimeverification/mir-semantics/actions/runs/22658250856/job/65672639933?pr=957))

## Test plan

- [x] Integration tests pass with the `-k` filter applied
- [x] Verify CI time improvement

Resolves #971 (Phase 1)

---------

Co-authored-by: Everett Hildenbrandt <everett.hildenbrandt@gmail.com>
Co-authored-by: dkcumming <daniel.cumming@runtimeverification.com>
This PR adds basic support for [IEEE 754 Floating Point
Numbers](https://en.wikipedia.org/wiki/IEEE_754), specifically `f16`,
`f32`, `f64`, `f128`.

These are already supported in K through builtins (see
[domains.md](https://github.com/runtimeverification/k/blob/master/k-distribution/include/kframework/builtin/domains.md#ieee-754-floating-point-numbers)).
This work is derivative of the implementation in the c-semantics (see
ieee754.k in that repository).

In particular:
- 6 tests are added that tests each type for equality, negation,
comparison, casting, arithmetic, and special values (NaN and Infinity)
- Documentation and helpers for floats are added to numbers.md
- Decoding is added for floats from bytes in numbers.md (see note on
haskell backend below)
- Semantic rules for arithmetic are extended for floats in data.md

### Haskell Backend 
The haskell backend has no `Float` builtins (no Float.hs in
[kore/src/Kore/Builtin/](https://github.com/runtimeverification/haskell-backend/tree/master/kore/src/Kore/Builtin)).
This means `kore-exec` crashes with "missing hook FLOAT.int2float" when
attempting to evaluate a float. The booster avoids this by delegating
Float evaluation to the LLVM shared library via `simplifyTerm` in
[booster/library/Booster/LLVM.hs](https://github.com/runtimeverification/haskell-backend/blob/master/booster/library/Booster/LLVM.hs).

Prior to being able to decode floats, they were left as `UnableToDecode`
which did not throw and error in the exec-smir test suite for
`--haskell-backend`. Now that they are able to be decoded, the haskell
backend throws on these decoded values. So I am now skipping any tests
with decoded floats for exec-smir with haskell backend.
## Summary
- remove the redundant `#forceSetLocal` helper now that `#setLocalValue`
no longer guards on mutability
- route moved-writeback and zero-sized-local initialization through
`#setLocalValue`
- drop the obsolete interior-mutability fast-path introduced by the old
branch state

## Why
After rebasing onto current `origin/master`, the original
interior-mutability writeback fast-path became obsolete:
`#setLocalValue` already permits writes to immutable locals, so the
extra helper and its special-case callsites no longer buy any behavior.

This PR turns the branch into the cleanup that current master actually
needs.

## Validation
- `make build`
- `cd kmir && uv run pytest src/tests/integration/test_integration.py -v
--timeout=600 -k "interior-mut or transmute-maybe-uninit-fail" -x`
  - 4 passed, 261 deselected
- started `make test-integration`; no early failures before stopping due
runtime
…pping strategy (#988)

## Summary
- Fixes stuck execution caused by incorrect projection chains from
`#pointeeProjection`
- Root cause: non-deterministic overlap between struct and array rules —
when source is a struct and target is an array (or vice versa), both
rules match and the LLVM backend's choice determines correctness
- Commit history shows why `[priority(45)]` alone doesn't work (it fixes
one case but regresses the other)
- Fix: always unwrap the source type first; target-side unwrapping
deferred to `#pointeeProjectionTarget`
- Reproducer from @dkcumming's review comment (minimal `Wrapper([u8;
2])` cast)

## Test plan
- [x] `ptr-cast-wrapper-to-array` passes (new reproducer)
- [x] `iter_next_2` still passes (regression test for opposite overlap:
`[Thing;3] → Thing`)
- [x] Full integration test suite passes

---------

Co-authored-by: Daniel Cumming <124537596+dkcumming@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…on (#813)

## Summary

Fix two issues preventing correct handling of zero-sized function item
types (e.g., non-capturing closures):

1. **`#zeroSizedType` did not recognize `typeInfoFunType`** (`types.md`)
— Function items are inherently zero-sized (`#elemSize` already returns
0), but `#zeroSizedType` returned `false`, preventing `rvalueRef` from
materializing uninitialized closure locals.

2. **`#decodeConstant` had no rule for `typeInfoFunType`** (`data.md`)
— Zero-sized function constants fell through to the `thunk` wrapper
instead of decoding to `Aggregate(variantIdx(0), .List)`.

## Evidence

`closure-staged.rs` with `terminate-on-thunk`:

| | Steps | Result |
|---|---|---|
| Before | 44 | `thunk(#decodeConstant(constantKindZeroSized, _,
typeInfoFunType(_)))` |
| After | 266 | `#EndProgram` |

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Daniel Cumming <124537596+dkcumming@users.noreply.github.com>
@Stevengre Stevengre changed the title chore: merge master's changes chore: sync feature/p-token with master Mar 31, 2026
@Stevengre Stevengre closed this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants