repair(mem): reconstruct memory runtime policy and diagnostics - #120
Draft
Skywind5487 wants to merge 3 commits into
Draft
repair(mem): reconstruct memory runtime policy and diagnostics#120Skywind5487 wants to merge 3 commits into
Skywind5487 wants to merge 3 commits into
Conversation
૮ >ﻌ< ა ci reviewran on ec4b510 — feat(mem-trim): restore fail-open runtime diagnostics ❌ Job failuresPython tests / Run tests slice 12/12 · View jobJob Python tests / Run tests slice 12/12 failed.
|
This was referenced Aug 19, 2026
Skywind5487
referenced
this pull request
Aug 19, 2026
Skywind5487
force-pushed
the
fork/memory-runtime
branch
from
August 19, 2026 06:10
ef26133 to
ec4b510
Compare
Owner
Author
|
Feature composition refreshed to current fork \main\ (\243352e7b).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge unit:
repair:memory-runtime(#110)Composes two internal work line PRs into one coherent memory-runtime repair.
Composition
line:memory-trim-policybase/memory-runtime-110(upstream parent3b9a963b8)line:memory-trim-diagnosticsfork/memory-trim-policy(stacked on #131)Each internal line exposes only its intent delta against the current-upstream
parent, so review surfaces stay minimal. This integration PR lands both lines
as one merge unit into
main.Summary
Repairs the Phase-2
repair:memory-runtimemerge unit from #110 on top of refreshed upstreammain(3b9a963b8e5cdb804a422755bed9a60fcd778273).This is a conscious port of the Phase-1 memory-runtime contracts onto the current merged allocator-trim seam, not a replay of the historical fork branch shape. The policy line remains independently correct; diagnostics extends it and is explicitly fail-open, matching the composition decision in PR #108.
Current-upstream / prior-art classification
trim_memory(),/proc/self/statussnapshots, glibc probing, lifecycle callers, normal cooldown, and the accepted forced-close floor.trim_memory()seam rather than introducing a second collection path.VmRSSfrom/proc/self/status.The durable preflight is recorded in
docs/research/memory-runtime-issue-110.mdwith pinned refs and reconstruction decisions.Policy behavior (from #131)
context.memory_trim.threshold_mbas a non-forced RSS low-water gate.VmRSS; unreadable/missing RSS fails open because telemetry absence cannot prove the process is below threshold.gc_cooldown_seconds(historical/default contract: 300 s).malloc_trim(0)remains eligible on the normal trim cadence while Python GC is cooling down.force=Truebypasses the RSS gate and GC cooldown while retaining upstream's accepted burst-close force floor.Diagnostics behavior (from #132)
gc_msandtrim_ms, and logs whether GC actually ran.VmSwapevidence from/proc/self/status.malloc_info(3), parsing only process-level totals so per-arena and root summaries are not double-counted./tmp/hermes_malloc_info_<pid>.xmlshape with libctmpfile().Regression coverage
Policy coverage in
tests/hermes_cli/test_mem_trim.pyincludes:Diagnostics coverage in
tests/hermes_cli/test_mem_trim_diagnostics.pyincludes:VmSwapparsing;Commit structure
docs(research): record #110 memory-runtime preflightfix(mem-trim): restore low-water and GC policyfeat(mem-trim): restore fail-open runtime diagnosticsCloses #110