Skip to content

gc: add telemetry and dirty-page remembered scanning#1106

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/gc-telemetry-dirty-pages
May 19, 2026
Merged

gc: add telemetry and dirty-page remembered scanning#1106
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/gc-telemetry-dirty-pages

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

@andrewtdiz andrewtdiz commented May 19, 2026

Summary

  • add PERRY_GC_TRACE JSONL telemetry for completed GC cycles, including phase timings, arena/malloc stats, remembered-set shape, write-barrier counters, evacuation, block persistence, and sweep/reset stats
  • add arena range side metadata for fast nursery/old/longlived generation classification and use it in write barriers without per-page classifier-table RSS growth
  • add slot-aware and external-slot dirty-page remembered tracking, old-page -> old-object indexing, and range-bounded dirty slot scanning for large arrays/objects/maps/closures
  • wire runtime object/map helper stores through the barrier path and add tests for metadata lifecycle, dirty-page scanning, external map pages, slot-range bounds, old-map test fixture cleanup, and initialized raw closure fixtures used by conservative-stack tests

Verification

  • cargo fmt --check
  • cargo test -p perry-runtime -> 280 passed
  • cargo test --release -p perry-runtime -> 280 passed
  • for i in 1 2 3 4 5; do cargo test -p perry-runtime gc::tests; done -> all 5 passed
  • scripts/run_memory_stability_tests.sh -> 18 pass, 0 fail; test_memory_json_churn.ts was 232 MB / 250 MB locally after compacting generation metadata
  • cargo check -p perry-codegen
  • cargo build --release -p perry
  • git diff --check HEAD
  • PERRY_WRITE_BARRIERS=1 PERRY_GC_TRACE=1 ./bench_json_roundtrip emitted 2 JSONL GC lines; jq -s -e confirmed telemetry field types
  • no-trace ./bench_json_roundtrip produced 0 bytes on stderr

@andrewtdiz andrewtdiz force-pushed the codex/gc-telemetry-dirty-pages branch 2 times, most recently from 937594d to bdaeb28 Compare May 19, 2026 09:38
@andrewtdiz andrewtdiz force-pushed the codex/gc-telemetry-dirty-pages branch from bdaeb28 to ae3bfb2 Compare May 19, 2026 16:13
@proggeramlug proggeramlug merged commit b698a3f into PerryTS:main May 19, 2026
9 checks passed
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.

2 participants