Skip to content

:contract-view-tests is red on main: build.w's tuple-destructuring let is not comptime-evaluable (NK_LET_ELSE) #2026

Closed

Description

@ehartford

Found while running src/main build :contract-view-tests --no-deps for #2003 (branch impl-2003, build.w byte-identical to origin/main c884c1c).

Every driver fails before any fixture is analyzed:

error: action target 'contract-view-tests' failed during comptime evaluation: build.w:2013:9: expression kind 62 is not comptime-evaluable yet

Reproduced with the pinned seed (src/main, digest 8c5a151d…), the installed v0.15.3.0, and a fresh out/release/bin/with built from the branch. Line 2013 is let (rc, audit) = contract_view_run(...) in run_contract_view_tests_action; a pattern let parses as NK_LET_PATTERN under NK_LET_ELSE (Parser.w let_pattern_node, #1370), and ComptimeEval.w has no NK_LET_ELSE case (falls to the generic 'not comptime-evaluable yet' at ComptimeEval.w:1738).

Expected: the target runs (it is a dep of :test). Either the evaluator learns pattern lets (then a seed carrying it), or the action stops destructuring.

Workaround used for #2003: ran the target's checks by hand with out/release/bin/with over test/contract/*.w (audit:contract verdicts for bad_/ok_, audit:all for ok_, expect-contract needles, and every .expected snapshot) — all agreed.

Activity

  1. added
    bug
    on Oct 3, 2026
  2. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Re-verified on a clean worktree of origin/main 0329966. Both full invocations are green: WITH=$PWD/src/main src/main build :contract-view-tests with the pinned seed, and with build :contract-view-tests with the installed compiler. Each runs the action in the native runner (14 fixtures agreed).

    The red was the invocation I used, --no-deps, over an out/lib and out/bootstrap-lib of another compiler generation. There the driver does not link the runner (#1797, build_runner_runtime_dirs_are_this_generation) and silently ran the action in its comptime evaluator, which is wrong in two places:

    1. NK_LET_ELSE (let (rc, audit) = …) had no case, so it hit the generic 'expression kind 62' refusal (ComptimeEval.w eval_expr).
    2. eval_tuple and eval_array recorded where their elements start before evaluating them. An element whose own evaluation laid out extra values first shifted every element after it. Here (result.rc, ctx.fs().read_text(p)) read back p, so with (1) fixed every needle check failed: a wrong verdict, not a refusal.

    The silence is a tool bug too: no line said why the runner was not used.

    All three are fixed in #2035 (branch fix-2024), with failing-first fixtures. With that stage1 as the driver, :contract-view-tests --no-deps over a foreign-generation out/lib passes and prints the note. Leaving this open until #2035 lands. The pinned seed keeps the old evaluator until the next reseed.

  3. added a commit that references this issue on Oct 3, 2026
  4. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main in 74e3001 (stack #2032; seed-driven battery GREEN on 2b9ad28, tree identical to main).

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions