Skip to content

Merge train: #9639 #9640 #9641 #9643 (+ macOS openpty fix) - #9650

Merged
proggeramlug merged 7 commits into
mainfrom
land-train98
Sep 3, 2026
Merged

Merge train: #9639 #9640 #9641 #9643 (+ macOS openpty fix)#9650
proggeramlug merged 7 commits into
mainfrom
land-train98

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Lands four independent fixes, all cherry-picked clean:

One portability fix carried: #9639's new PTY fixture would not have compiled on macOS. libc::openpty's trailing termios/winsize params are *const on Linux and *mut on macOS, and the fixture passed std::ptr::null(). Now null_mut() for all three, which coerces on both platforms.

Validation: run_lint_gates.sh all 62 gates pass; release build green; RUST_TEST_THREADS=1 perry-runtime 3060/0; perry-stdlib green; issue_9589_idle_reclaim_heap_descends green.

Rebase-merge preserving authorship.

Ralph Küpper added 7 commits September 3, 2026 20:38
Hold incomplete ANSI escape prefixes against an explicit 500 ms deadline registered with the event pump. Unrelated loop turns no longer flush early, idle waits no longer flush late, and completing bytes cancel the one-shot.\n\nCover bare Escape under idle and interval-driven schedules plus split and complete arrow sequences on a real PTY.
The reducer scored a full productive only when `old_gen_in_use_bytes`
dropped. That number is the sum of the live old blocks' bump offsets, and
a non-moving sweep cannot lower it: dead objects go back to the old-gen
free list and the block keeps its offset, so only a whole-block release
moves it. The unit tests passed because their litter fills blocks that
end up entirely dead; every real workload does not.

Measured on the compiled claude-code TUI, in a session with 279
collections behind it: two reducer fulls freed 2.37 MB and 0.51 MB while
occupancy stood at 93.6 MB with 50 MB already on the old-gen free list,
both scored unproductive, and the activity requirement had doubled twice
inside a minute of idle. The reducer was switching itself off on exactly
the workload it was built for.

Price the full by the freed-bytes count the cycle already reports. The
occupancy delta stays in the counters and on the diag line as the
whole-block-release signal it actually is, next to a new `reusable=`
field: the free-list residue that only compaction can return to the OS,
which a budgeted (non-moving) cycle cannot do.

Claude-Session: https://claude.ai/code/session_011qE5TRRJFzqxN44K34AnG2
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