Skip to content

Floor memory: per-phase held-set attribution; retained-structure census at seams; parse index dropped after planning - #12774

Merged
gunbai-bot[bot] merged 19 commits into
mainfrom
session/sleek-ibex-207
Oct 1, 2026
Merged

gunbai-bot[bot] merged 19 commits into
mainfrom
session/sleek-ibex-207

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Cost lane, node adhoc-64586b4c-223 (manager jolly-boar-500). Part (1) of the brief, the instrument, plus two lifetime fixes. The measurement at the ~5.4k-seed #12381 subject runs on srv1 via neat-boar-16. Its result and the chain re-derivation (part 3) follow here.

What the floor already showed

Reading the seam beats of merge_group run 36675207241 (today's small subject):

  • Live heap: parse and planning leave about 11 GiB resident; prepare-closure-resolve adds about +9 GiB (the only term that grows with seeds); nothing is freed afterwards.
  • The leaf sat at the 25 GiB memory.high line with 2 to 4 GiB in swap.

No entry point reduced these beats per phase, and nothing named which structures hold the memory.

Changes

  • gunbc.floor_demand floor_phase_attribution: a fold over a run's own beats. A seam beat opens a phase and watchdog beats stay in it. Each row gives the phase's entry held set and its in-phase peak; what the phase left resident is the next row's entry. It reuses floor_seam_of_token and beat_held_set, so there is no second held-set rule, and an unknown token refuses.
  • //gunbc/instruments:floor-memory-qualification: the supervisor tees the child's stderr and transcribes the [floor-cgroup] beats as primitives. A counter printed as na refuses rather than reading as zero, because .dag has no string parsing. The fold's rows are rendered beside the unchanged verdict. This extends the existing route; no new label.
  • floor_retention_census replaces the uncalled whole_tree_ancestry_retention_probe. At the nominal-subject-seeds and prepared-subject-warm seams it reports, for the process resolve store and the prepared graph:
    • retained versus distinct entries for each typecheck-env map. The per-module ancestry maps are the lead suspect for retained size that grows faster than linearly with the closure.
    • module-identity versus TypedModule-allocation counts, which answers whether the planning graphs are duplicate typechecks (§2).
  • New seam bare-reference-edge-index-warm, with a typed FloorSeam arm and token row; every_floor_seam_literal_has_a_typed_arm covers it.
  • Parse-phase DeclarationIndex: it is moved instead of cloned, and the floor drops it once the planning observation returns. It used to be held for the whole floor, although only the planning row reads it (§6 bare minimum).

Evidence

  • Remote cargo check --all-targets is green, with a must-fail control that did fail.
  • transcription_tests (2) and every_floor_seam_literal_has_a_typed_arm pass.
  • Not yet executed: the new .dag witnesses in floor_phase_attribution_witness_test. Standalone gunbc run on that entry did not finish within 15 minutes, so the floor's changed-witness sublane on this PR is their first execution.

Not in this PR

🤖 Generated with Claude Code

…ation; structure census at seams; parse index handed over and dropped after planning

- gunbc.floor_demand floor_phase_attribution: fold over the run's own seam/watchdog beats (entry, in-phase peak; left = next phase's entry), reusing floor_seam_of_token and beat_held_set; unknown token refuses.
- //gunbc/instruments:floor-memory-qualification: the supervisor tees the child's stderr, transcribes [floor-cgroup] beats (na counters refuse), and renders the fold per phase beside the verdict.
- floor_retention_census (replaces the uncalled whole-tree ancestry probe): retained vs distinct entries per typecheck-env map, and module-identity overlap, over the process resolve store and the prepared graph at nominal-subject-seeds and prepared-subject-warm.
- New seam bare-reference-edge-index-warm with its typed FloorSeam arm.
- The parse phase's DeclarationIndex is moved (not cloned) to the floor, which drops it once the planning observation returns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review September 30, 2026 11:50
gunbc-ci-auto-heal and others added 2 commits September 30, 2026 12:10
…ad stall/swap supplied-value claim

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e, refuse (not clamp) counters past i64, declare the primitive-boundary dissolution trigger

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Addressing review 73204 in 71392ec:

  • Bare Int counters (stall_per_min, swap_bytes and the ten byte counters): now a declared, typed debt. gunbc.floor_demand floor_beat_reading_primitive_boundary is a DissolutionCondition with dissolve-on: feature:interpreter-constructed-measure-arguments. It names the capability: the interpreter's argument surface admitting a constructed ByteSize / EventsPerMinute from the host. When that capability lands, the fields become measures, the refusal moves to the host reader, and nat_magnitude leaves the fold. The same trigger dissolves qualify_floor_memory_from_readings' existing primitive signature, whose precedent this follows.
  • nat_magnitude is an absolute value (confirmed): floor_reading_has_negative_counter now refuses any negative counter before the lift, as a new FloorPhaseReadingNegative { beat } arm. A new supplied-value witness, a_negative_counter_refuses_rather_than_lifting_to_its_magnitude, covers it.
  • The same class on the host side: i64::try_from(v).unwrap_or(i64::MAX) clamped a counter past i64 into a value nobody read. It now refuses the attribution and names the beat.

gunbc-ci-auto-heal and others added 3 commits September 30, 2026 15:17
…ache

The cache is a typecheck-time carrier (the union of each module's ancestry, consumed only by a later
importer's typecheck). The strict prepared subject is closed and never re-resolved, and no
PreparedRepository reader touches it; floor_retention_census showed every module holding its own
spine (tec.variant_locals ~39M distinct entries over 2335 modules on the main subject). Project it
away at the owner so it drops when the strict resolve returns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…easured saving (~0.18 GB; im::HashMap shares nodes across merged parents)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…dentity grain

Every module path held by more than one TypedModule allocation is compared component-wise (module
node, type bindings' resolved nodes, ancestry bindings, parent module paths, function signatures,
parent function envs), by Rc pointer and module path. Gates moving the per-graph rewire to one
wiring per module at the pool's MultiEntryIndex.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

On review 73275's advisory, the receipt for new hand-written Rust:

  • No deleted scaffold offsets it. The one deletion is the uncalled whole_tree_ancestry_retention_probe, and the census that replaces it is about the same size. The Rust in floor_memory_supervisor.rs and target_invocation_host.rs grows.
  • Admission is the v1 purpose test (gunbc.v1_maintenance_standing v1_seed_standing): the change serves the required floor's cost, which is on the v2 self-host path. No growth for its own sake.
  • The Rust is what the host must do and .dag cannot yet. It reads a child's stderr, splits a beat line into tokens, and lifts decimal text to integers. The interpreter registers only string_contains and string_length (recorded in gunbc.observation_emit_census), and it admits no constructed measure across the argument boundary. That second limit is declared, with its capability trigger, in floor_beat_reading_primitive_boundary, and dissolving it moves the negative-count refusal to the host.
  • The meaning stays in .dag: which arm a token is, what the held set is, and where a phase begins are all decided in gunbc.floor_demand.
  • The census and wiring differential are host reads of Rust-side structures. TypedModule and TypeEnv pointers have no .dag carrier, so they are a mitigatable-rung instrument and not a model.

If a tracking row is wanted for the transcription half, the natural home is the same trigger as floor_beat_reading_primitive_boundary. I've not minted a second row for one boundary.

— sent from sleek-ibex-207

gunbc-ci-auto-heal and others added 2 commits September 30, 2026 16:21
… time where the floor frees it (strict refusal, prepared teardown), reading mallinfo2 per drop

Order-dependent by construction and reported so: TypeEnv is split into its maps and dropped first,
so each map's figure is a lower bound on its exclusive bytes; shared graphs/modules report
unattributable rather than zero. Armed by the floor only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…a), not a Bool flag beside a meaningless Int

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Review 73301, hand-rolled optional pairs (stall_read + stall_per_min, swap_read + swap_bytes): fixed by construction in d2055cd.

  • FloorBeatReading.stall_per_min and .swap_bytes are now Int?. Absent is the heartbeat's na, so a reading can no longer carry a number beside a false flag.
  • The host passes the interpreter's own Optional variant (Present { value } / Absent), never a zero.
  • floor_beat_of_reading matches the optional to StallRead/StallUnread and SwapRead/SwapUnread.
  • The negative-count refusal now reads through optional_count_is_negative, so an absent counter is not negative and a present negative one refuses.
  • The witness an_unread_stall_and_swap_reach_the_phase_as_unread now supplies none for both.

The artifact text I received ends partway through this finding. If there are further findings after it, I haven't seen them.

gunbc-ci-auto-heal and others added 5 commits September 30, 2026 17:07
…nction return

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…f base's checkout is a different module)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…e attribution; heads-parse-count test)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ibution; floor execution demand moved in by #12788)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s have another owner (measured unchanged)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 2 commits September 30, 2026 21:23
…nd after shells / includes shared residue)

A late class is credited nodes it shared with earlier ones; read as a saving, emit_graph_info's
4.06 GB at #12381 predicted a cut that measured -0.07 GB (neat-boar-16's A/B on gunbc#12832).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ocking_diagnostics refusal

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Oct 1, 2026
…tails

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Oct 1, 2026
…carry item_leaf_owner_modules

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gunbc-ci-auto-heal and others added 3 commits October 1, 2026 00:24
… item_leaf_owner_modules

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…or-memory instrumentation's seed growth

- prepared_graph_without_typecheck_caches, the census doc and the byte probe's reading note keep
  the instrument names and the reasoning and drop transcribed figures (DESIGN §6).
- gunbc.floor_memory_instrumentation_seed_growth: the hand-authored census, byte attribution,
  beat transcription and cache-lifetime fix, with reason, v1_seed_standing admission and a
  capability trigger per half; registered in gunbc.seed_growth_admission.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Review 73476, both findings fixed in 465ce1d:

  • Transcribed figures (DESIGN §6). The prepared_graph_without_typecheck_caches doc, the census doc and the byte probe's reading note now name the instrument and keep the reasoning; the copied figures are gone. The cache-size claim cites //gunbc/instruments:typed-graph-exclusive-bytes (type_env_cache) as its re-deriver.
  • Hand-Rust receipt. gunbc.floor_memory_instrumentation_seed_growth declares every hand-authored declaration this PR adds (census, wiring identity, byte attribution, beat transcription, phase rendering, and the cache-lifetime fix). It carries the reason, the v1_seed_standing purpose admission against the five refused classes, and a capability trigger per half:
    • The typed graph becomes a .dag value, plus a modeled allocator observation.
    • The existing floor_beat_reading_primitive_boundary trigger, for the transcription.
    • It is registered in gunbc.seed_growth_admission.

— sent from sleek-ibex-207

…bled or negative stall or swap refuses like a stat counter

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Review 73487 fixed in 9335a15. transcribe_floor_beats now reads stall and swap through unread_or_count: the literal na (and only that spelling) is None, a non-negative integer is read, and a missing, garbled or negative value refuses with a located error, the same as the stat counters beside it. The doc comment says exactly that. The new test a_garbled_stall_or_swap_refuses_rather_than_reading_as_unread (a negative stall, and swap 4k) passes beside the two existing transcription tests.

— sent from sleek-ibex-207

@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 6b324f0 Oct 1, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/sleek-ibex-207 branch October 1, 2026 04:58
gunbai-bot Bot pushed a commit that referenced this pull request Oct 1, 2026
…et of the seed-growth row and the exclusive-bytes host producers

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@briansrls
briansrls restored the session/sleek-ibex-207 branch October 1, 2026 23:25
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.

0 participants