Skip to content

emit-c: no hash and equality functions for a composite map key, so emit-c-test (the no-LLVM bootstrap) is red: sema_empty_state's (i32, i32) key #2409

Closed

Description

@ehartford

§11.7 (map keys), D96; bootstrap runbook "Scope of the C backend" (the emit-c lane must emit the compiler's own source; gate with build :emit-c-fixpoint).

src/main build :emit-c-test fails on main (verified on e08113b, the battery-time-2 branch point before any emit-c change, and on its successors):

error: C emission failed: in sema_empty_state__21853: emit-c has no hash and equality functions for a map key of type (i32, i32) (#2180)

The LLVM backend gives a composite key (kind 2) generated hash and equality functions (CodegenDispatch.w mir_map_key_kind, mir_map_key_hash_fn, mir_map_key_eq_fn); CCodegen.w map_key_kind_text handles only kind 0 (bytes) and 1 (str) and refuses the rest loudly, as it should. Since #2180 closed, the compiler itself uses a tuple key, so the emit-C bootstrap cannot emit the compiler.

Expected: the C backend generates per-key-type hash and equality functions mirroring the LLVM ones (the runtime keyed hasher fed the parts in == order) and passes them to with_hashmap_new_keyed.

emit-c-fixpoint is not in the battery, which is how this went unseen; once green it belongs there (it measures the bootstrap lane the runbook makes the C backend's only job).

Workaround: none; the lane is red.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced; it is the first blocker of the emit-C lane (#955).

    $ with build src/main.w --emit-c --bundle-corpus std/engines/pcre2 -o main.c
    error: C emission failed: in sema_empty_state__23896: emit-c has no hash and equality functions for a map key of type (i32, i32) (#2180)
    rc=1
    

    post-release: the emit-C lane campaign.

  2. added this to the post-v0.16.0 milestone on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions