Skip to content

doc: wasm docs wrongly say the backend never sees fused opcodes #607

Closed

Description

@bpowers

Three sentences still say the wasm backend only ever sees un-fused opcodes, which is wrong.
The peephole pass in ByteCodeBuilder::finish() emits AssignConstCurr, BinOpAssignCurr and BinOpAssignNext before the bytecode is cached, so the wasm backend sees them in nearly every model; only fuse_three_address in Vm::new is private to the VM.
The code handles this, and src/simlin-engine/src/wasmgen/lower.rs documents both passes correctly.

Fix

Reword to match lower.rs:

  • docs/design-plans/2026-05-20-wasm-backend.md, lines 106 and 130
  • the rustdoc in src/simlin-engine/src/wasmgen/module.rs around line 550 ("plain, un-fused scalar set")

Activity

  1. added
    engine
    hygiene
    rust
    on May 21, 2026
  2. changed the title [-]wasm-backend plan: false 'CompiledSimulation is fully un-fused' premise misleads un-executed phases 2-8[/-] [+]doc: wasm design plan wrongly says the backend never sees fused opcodes[/+] on Oct 12, 2026
  3. added
    docs
    on Oct 12, 2026
  4. changed the title [-]doc: wasm design plan wrongly says the backend never sees fused opcodes[/-] [+]doc: wasm docs wrongly say the backend never sees fused opcodes[/+] on Oct 12, 2026
  5. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing: 12b1df5 corrects the design plan and the rustdoc in wasmgen/module.rs to say the backend sees the peephole-fused assignments; only the late 3-address fusion is private to the VM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsenginehygienerust

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions