Skip to content

Floor OOM (rustc-children half): isolate EmitHostGate from the wide discovery batch - #5837

Merged
briansrls merged 8 commits into
mainfrom
session/calm-carp-204-floor-precompute
Jun 26, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/calm-carp-204-floor-precompute

Conversation

@briansrls

@briansrls briansrls commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

What

EmitHostGate spawns child cargo/rustc processes (~1.5 GiB) that the 8 GiB floor cgroup counts. But ci_floor_plan only serialized gates where gate_is_heavy_resolve == true (EmitHostGate => false), so emit-host shared the wide discovery batch and its rustc peak overlapped the ~2 GiB corpus shards → floor OOM (exit 137).

Fix (§2/§3 decompose, not a third ad-hoc boolean)

gate_is_heavy_resolve (whole-tree resolve cost) and gate_spawns_host_compiler (rustc-children cost) are two grounded contributors to one concept: gate_serializes_against_corpus. floor_dependencies now serializes on the union, so EmitHostGate gets a floor_corpus_serializes edge and lands in a batch with no concurrent discovery shard. Discovery corpus still runs wide.

Marked Scaffold dissolving into std.realization_schedule.Runnable cost (the resource-aware scheduler's per-Runnable space cost) — the boolean collapses to cost.space > threshold once that lands. (gentle-newt-542, the scheduler owner, is archived; no live fork.)

Proof (green by execution)

ci_floor_plan_witnesses passes; added witness_emit_host_isolated_from_corpus + a discriminating control (serialize-off co-locates emit+corpus). Perturbation-proven RED: reverting the predicate to bare gate_is_heavy_resolve flips the test to false.

Relationship to the rest of the floor-OOM work

This is the rustc-children half. The other half is Layer A (resolve env de-merge, tidy-wren-707). With this + #5836 (budget→real 8 GiB cap), the discovery shards alone are ~2.1 GiB so width=3 may fit under 8 GiB — to be confirmed by CI once #5836 lands.

Scope doc: docs/plans/emit-host-batch-isolation.md

🤖 Generated with Claude Code

Brian Searls and others added 7 commits June 26, 2026 15:53
precompute_whole_tree_published_mock_keys Strict-resolved the entire 608-module
dsl tree into one ResolvedGraph just to read 58 published-mock keys from the 13
modules that declare PublishedMockCase, then discarded the graph — §2 irrelevant
work run unconditionally, and the per-shard floor runner's dominant RSS.

Phase-peak RSS of claim_batch resolving one tiny witness:
  after build_multi_entry_index ......... 11 MB
  after precompute_whole_tree_... ....  1529 MB   <- the whole jump
  after the witness resolve ..........  1535 MB

Fix: select declarer modules (.contains prefilter is a safe over-inclusive
candidate set — .dag has no comment syntax so the match is structural, and the
downstream exact type_annotation_names check keeps it correct) and resolve only
their transitive import closures.

Result (same 58 keys; non-mock witness and all 9 lens_mock_totality published-mock
consumers pass):
  precompute step ...... 1529 MB -> 37 MB
  per-shard peak RSS ... ~1.57 GiB -> ~0.18 GiB   (8.7x, no cap/per_shard/hardware change)

claim_batch is the per-shard runner whose [measurement] per-shard-peak-rss the
floor's per_shard budget (the 2.1->2.5 GiB that drove the OOM saga) is calibrated
from, so this lowers that budget at the root. Design + deferred representation
work: docs/plans/resolved-graph-representation-minimization.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
html_markup_smoke_test.rs declared extdeps_root twice (identical); the first is
shadowed/unused, failing the gate's -D warnings. Pre-existing on main (the v1
rust gate's first hard error). Remove the dead duplicate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot gunbai-bot Bot changed the title CI profiling Floor OOM (rustc-children half): isolate EmitHostGate from the wide discovery batch Jun 26, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 26, 2026 17:51
@briansrls
briansrls merged commit 91fea92 into main Jun 26, 2026
1 of 4 checks passed
@briansrls
briansrls deleted the session/calm-carp-204-floor-precompute branch June 26, 2026 19:22
briansrls added a commit that referenced this pull request Jun 27, 2026
…s floor red (#5859)

resolved-graph-representation-minimization.md and emit-host-batch-isolation.md
(authored by calm-carp-204, archived) had zero inbound links, so they were orphan
in the doc-reachability graph (roots = ROADMAP.md / DESIGN.md / runbooks). Both
document LANDED root fixes — 7ce8231 (mock-key precompute scoped to declarers'
closures, 8.7x) and #5837 (EmitHostGate batch isolation) — so they are keep, not
delete. Link both from resource-aware-scheduler.md, which is root-reachable via
ROADMAP.md and is their exact parent: they are the root-cause analyses behind the
per_runnable_peak that scheduler consumes.

Proven by execution (doc_graph_has_no_orphan_docs, clean origin/main tree):
false (2 orphans) without the links, true (orphan_count == 0) with them.

This is pre-existing main-red that #5855 unmasked by letting the floor run to
completion, not a regression introduced here.

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant