Skip to content

Re-enable continuous fuzzing once Zig toolchain is fixed #74

Description

@kwsantiago

Context

PR #73 added std.testing.fuzz targets for the hand-rolled NIP-13 PoW scanners in handler.zig (getCommittedDifficulty, extractNonceTarget, validateMessageStructure). They are written and smoke-run under zig build test, but zig build test --fuzz cannot run them.

Problem

Zig 0.16.0's bundled test runner fails to compile in fuzz mode:

compiler/test_runner.zig:566:55: error: pointer type child 'builtin.StackTrace'
cannot cast into pointer type child 'debug.StackTrace'

The fuzz error path passes @errorReturnTrace() (*builtin.StackTrace) to std.debug.writeStackTrace, which expects *const debug.StackTrace. This code is only analyzed under -ffuzz, so normal zig build test is unaffected. Reproduces on a trivial standalone project, so it is a toolchain bug, not wisp's.

Interim mitigation (already in PR #73)

A deterministic 100k-iteration randomized stress test exercises the scanners under normal zig build test, relying on Debug safety checks to catch OOB/overflow.

Action when unblocked

Once the Zig toolchain ships a fix (or we bump to a release that has it):

  • Verify zig build test --fuzz discovers and runs the existing fuzz targets.
  • Optionally add a short fuzz step/CI job and seed a corpus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions