Skip to content

WebAssembly corpus: add a bit-exact runner for NaN payload assertions #261

Description

@chrisbbreuer

Parent: #260
Roadmap: #141, #134

Problem

The pinned wg-1.0 corpus currently has 151 assert_return commands whose action arguments or expected results contain an exact f32/f64 NaN payload or sign. All 151 otherwise-unexplained result mismatches are in this class.

The current corpus evaluator deliberately exercises the public JavaScript WebAssembly API. That boundary represents WebAssembly floats as JavaScript Number, so it cannot reliably carry every f32/f64 NaN payload/sign bit pattern. Treating these commands as engine failures would be misleading; treating them as silently passed would weaken the score.

Complete implementation

  • Add a corpus execution path that can pass f32/f64 arguments and collect results as raw WebAssembly bits.
  • Keep module decoding, validation, imports, linking, start functions, traps, registrations, and mutable store state equivalent to the public API path.
  • Score exact-NaN assert_return commands through that path without canonicalizing the expected or actual values.
  • Retain public-API scoring for commands that are observable exactly through JavaScript.
  • Add focused regression coverage for positive/negative canonical and arithmetic NaNs, payload preservation, memory round trips, locals/select, and conversions.
  • Record the runner mode/reason per command in the machine-readable inventory.
  • Regenerate the full pinned wg-1.0 inventory and update README/docs evidence.

Acceptance

  • No exact NaN payload/sign command is classified as a zig-js runtime failure merely because JavaScript Number erased the distinction.
  • Every such command is either passed by the bit-exact runner or remains an explicit, issue-linked limitation in the inventory.
  • zig build wasm-spec remains strict: genuine applicable failures and runner errors fail the command.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions