Skip to content

decoder: remove dead stub-immediate path, fix stale docstrings - #127

Merged
mfornet merged 2 commits into
mainfrom
split/decoder-dead-code
Jul 14, 2026
Merged

decoder: remove dead stub-immediate path, fix stale docstrings#127
mfornet merged 2 commits into
mainfrom
split/decoder-dead-code

Conversation

@El3ssar

@El3ssar El3ssar commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

decoder: remove dead stub-immediate path, fix stale docstrings

stubImmediateCount unconditionally returns none (all GC ops are decoded for
real now), which makes the some n => consumeStubAtoms … branch that calls it
statically unreachable and consumeStubAtoms dead. This removes both and folds
the branch to its only reachable arm (.ok rest), keeping the live
consumeBrOnCastImmediates case untouched — behaviour is unchanged.

It also refreshes several comments that no longer match the decoder: the
top-of-file and parseModule docstrings (type/table/memory/global/elem/data/tag
content is fully parsed now, not discarded), the parsePlainOp catch-all
(floats and SIMD are modelled; the fallback only stubs still-unmodelled proposals
like atomics), and the isMemOp comments (memory ops emit real load/stores).

`stubImmediateCount` unconditionally returns `none` (all GC ops are decoded for
real now), which makes the `some n => consumeStubAtoms …` branch that calls it
statically unreachable and `consumeStubAtoms` dead. This removes both and folds
the branch to its only reachable arm (`.ok rest`), keeping the live
`consumeBrOnCastImmediates` case untouched — behaviour is unchanged.

It also refreshes several comments that no longer match the decoder: the
top-of-file and `parseModule` docstrings (type/table/memory/global/elem/data/tag
content is fully parsed now, not discarded), the `parsePlainOp` catch-all
(floats and SIMD are modelled; the fallback only stubs still-unmodelled proposals
like atomics), and the `isMemOp` comments (memory ops emit real load/stores).
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Verifier report preview: https://talos-verifier-report-pr-127.vercel.app

(This URL is stable for this PR — it always points to the latest build of 89cfc64.)

@El3ssar
El3ssar marked this pull request as ready for review July 6, 2026 16:31
@El3ssar
El3ssar requested a review from mfornet as a code owner July 6, 2026 16:31
Address code-review findings on the decoder cleanup and the new slice corpus:

- Wat.lean: the module-header and `parseModule` docstrings claimed non-func
  imports are "dropped"; they are in fact parsed into `globals`/`tables`/`memory`
  and recorded in `importedGlobals`/`importedTables`/`importedMemories`. Reword to
  match. Also remove the now-unreachable `br_on_cast` arm in the `parsePlainOp`
  fallback (handled by an explicit arm) and its orphaned `consumeBrOnCastImmediates`.

- Array trunk: add chunk-generic `unSliceBodyTerminates`; `isEmptyBodyTerminates`
  and the new symmetric `lenBodyTerminates` are one-line instances, so the `len`
  callee bridge no longer hand-rolls the `of_returns_wp` glue. Drop the now-unused
  op-specific `lenBodyWp`/`isEmptyBodyWp` (subsumed by the generic `unBodyReturnsWp`).

- RustArray/Spec.lean: bridges first, internal specs reuse them at `initialStore`
  (matching RustArrayTests) instead of duplicating the callee term.

- Add `open_slice_export` macro factoring the uniform export-proof head; apply to
  all six slice export proofs.

Verified: codelib and programs both `lake build` clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mfornet
mfornet merged commit 9c55e52 into main Jul 14, 2026
5 checks passed
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