Skip to content

D44 map transfers, D97 TotalF64, deep-debugging tools, and the fixes their batteries found - #2204

Merged
ehartford merged 14 commits into
mainfrom
d44-map-transfers
Oct 6, 2026
Merged

ehartford merged 14 commits into
mainfrom
d44-map-transfers

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #2191, #2182, #2198, #2199.

Battery: GREEN on d5c6ef3 (gate 769s, uat 26s, battery-checks 945s).

Eric Hartford added 14 commits October 5, 2026 15:30
… drain (#2191)

HashMap and BTreeMap present the spec's transferring traversals:
MapIntoIter, MapIntoKeys, MapIntoValues and MapDrain. The entries move out
together, last first, so each step pops the next in the map's order and
the ones never yielded drop with the iterator. A HashMap entry moves out
through a std-only slot_take (with_hashmap_take_at: the key's and value's
bytes go to the destination, the entry dies without a drop), lowered by
both backends; the slot accessors are exempt from the key check, since
they neither hash nor compare. The dead snapshot runtime functions
(with_hashmap_keys_out/values_out/items_out) are gone.
…jection (#2182)

std.traits declares TotalF64/TotalF32 (distinct f64/f32): every NaN is one
key, -0.0 is 0.0, and the order puts NaN above every number (D97). Two
lowering fixes make the projection the comparison:
- MIR keeps Sema's type on a comparison's operands when that type
  compares by key projection or cmp: a folded TotalF64(1.0) was a bare
  float constant, and codegen compared the floats;
- codegen's == dispatch tries the key projection first, whatever the
  representation, and a projection with no function is a loud ICE.
Also: a distinct's .value lowers with the inner type (it kept the
wrapper's, so f"{t.value}" stopped in codegen with no :? formatter;
lldb: call_debug_formatter <- coerce_typed_val_to_str <-
mir_emit_ext_format_intrinsic_call). The float-key error names
TotalF64. D99 records the placement (delegated).
A flag the driver does not know printed ok: the removed --dump-drop-flags
and any misspelling read as a clean check that never ran. check, ir and run
(its driver arguments, before the source) now name the flag, suggest the
nearest known one, and exit 2. deep-debug-tool-tests pins the refusal.
…t constructor keeps its type

audit:resolution judges every expression MIR lowers: the operand
MirBuilder.lower_expr returns has the type Sema gave the node in this
instance (recorded per body; the operand's type is the place's recorded
type). Sema's own adjustments are its type (contextual copy, splat, lane
conversion); pass-through forms are judged through their inner node.
Clean over 150 behavior/spec files (one disagreement found: grouping
passes an adjusted operand through; now judged at the inner node).

It found the root of D97's equality bug at once: a distinct constructor
T(x) lowered as its inner value with the inner type. The constructor now
binds the value at the wrapper's type, and the comparison workaround in
lower_bin_op is gone (one owner).

select:kind=operator lists how codegen lowered each binary operator: the
mir_build_bin_op route and the operand types (detail in key:value words,
detail~fn:main). A select naming codegen facts now runs the backend; the
codegen-argument facts were unreachable through select before.

An unsupported float operator was an undef with no report; it is a loud
ICE. deep-debug-tool-tests pins the clean audit and the key-projection
route; the page and AGENTS.md document both tools.
…unction

Per parameter a returned view may come from: from its own storage or only
through what it views, with the node that first made it so. Per view
binding: each bind/store/loop event with origins, storage and deps. Runs
on a failing compile. The binding table is gone after a body is checked,
so #2187 was hunted with trace prints; Sema now keeps the facts.
lldb on the installed compiler had only regex breakpoints, no source lines
or arguments. The release link's with.unstamped.dSYM is the stamped
binary's (stamping keeps the Mach-O UUID); it installs as with.dSYM with
the DWARF file renamed, through a temp sibling and a rename. A stale dSYM
is always removed; an SDK without dsymutil says so.
… is printed (#2199)

Fifteen paths in mir_const_value, mir_eval_operand and mir_eval_rvalue
returned undef silently (three warned only under WITH_DEBUG_FALLBACK);
the noalias walk skipped a non-function or out-of-range parameter, said
so only under WITH_MIR_AUDIT. Each now sets had_error through
mir_bug_undef, whose detail names the function. Backend never printed
codegen_error_detail at all: 'error: code generation failed' now carries
it. WITH_DEBUG_FALLBACK is retired.

Closes #2199
The 2026-10-05 battery went red on raylib_spiral: GLFW found no monitor
on a locked session (CGSSessionScreenIsLocked=Yes), and main's compiler
failed identically. The display probe saw an online display and said the
requirement was met. It now reads the console session through ioreg and
skips with 'the screen is locked'.
… is not .value

The distinct .value shortcut read get_type_d0 of the base's type and
looked it up in distinct_type_names without checking the kind. A
pointer's d0 is its pointee's TypeId: once std.traits declared TotalF64,
the pointee of CiGotoSwitchCase.state numbered like a distinct's name,
and cases.state.has_default lowered as cases.state (a pointer into a
bool). Found by the battery: emit_switch_dispatch's typed MIR was
refused on check src/main.w (dump-mir: _14 = copy _6.state), and the
release compiler built from that MIR rejected behav_mutex_set_view_scoped.
Every other distinct_type_names check already guards on TY_STRUCT.
A distinct is its inner type in C (typedef double TotalF64); place_text
rendered .value as a member access, and every emit-C case failed once
std.traits used TotalF64.value. test/emit_c/distinct_value.w pins it.
The ICE named a span that was the end of the file for a synthesized
statement; it now names the function. The invalid module was discarded,
so --dump-mir and --explain-mir-origin printed nothing exactly when the
MIR was wrong; it stays for them, and codegen still refuses (errors).
A &str view is its {ptr, len} (#1810) and with_runtime.h takes
with_str sep; the C backend passed the address, and the emitted C did
not compile (test/emit_c/map_transfers.w, parts.join(" ")).
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on d5c6ef3: gate rc=0 769s, uat rc=0 26s, battery-checks rc=0 945s.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D44: maps have no into_iter, into_keys, into_values or drain

1 participant