Skip to content

check --validate-all on a bootstrap stage1 parks at 7 GB in the drop-state driver; the release binary answers in 0.1 s #1282

Closed

Description

@ehartford

Found while fixing #1229/#1230 (branch fix-1229-1230); pre-existing, verified on the main tree's own stage1.

Repro (any program; this is #1229's six-line repro):

out/bootstrap/bin/with-stage1 check r1229.w --validate-all     # never returns
out/release/bin/with          check r1229.w --validate-all     # validate-all: ok, 0.16 s
~/.local/bin/with             check r1229.w --validate-all     # validate-all: ok, 0.07 s

Both stage1 binaries tested (~/with/out/bootstrap/bin/with-stage1 built 06:59 from main before my changes, and the branch's) reach the identical profile: RSS 7,320,128 KB after 60 s, still climbing at 3:25 elapsed, killed. check src/main.w --validate-all on the same binary parks at 7.75 GB.

Hot spot (sample <pid> 5 on the parked process, call graph under main):

1420 with_vec_push
1370 __with_mod_...__vec_grow
 305 MirDropStateBlocks.load_block   -> with_vec_push
 206 MirDropStateBlocks.store_block
 200 rt_mmap
 158 rt_free_unlocked_with_drop_origin -> __munmap
  79 MirDropStateBlocks.input
  27 mir_drop_state_join
  19 MirDropStateMap.equal

Every sample is in MirDropStateBlocks.load_block/store_block pushing whole block vectors (and the runtime mmap/munmap under them) -- the drop-state driver that validate_all_file (src/compiler/Compilation.w:1795) reaches, not the shape or typed validators (those return in milliseconds and run first in validate_all_mir_module).

Why it matters. --validate-all is the sweep for a new typed-MIR rule during a compiler fix, and the bootstrap stage1 is the binary a fix is verified on (the release binary cannot carry the new rule). While this stands, a typed-validator sweep of src/main.w is impossible on the iterate tier.

Open question. Why the release binary and the stage1 differ on the same tree: different link root / embedded objects, or a stage1-only path in the driver. Not investigated; root cause is the exact line in MirDropStateBlocks that copies per block, found with lldb on the stage1.

Activity

  1. ehartford commented on Sep 22, 2026

    @ehartford
    ContributorAuthor

    Confirmed where the park is: on the same stage1, lldb -o "rb validate_ownership_mir_module$" -o run hits the breakpoint for both repros, so compile_file, run_mir_lower, the shape validator and the typed validator all return, and the process parks inside validate_ownership_mir_module (the drop-state driver in the sample above). Typed-validator sweeps on a stage1 can use that breakpoint as the pass oracle until this is fixed.

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