Skip to content

tooling(gc): lightweight root/TLS/ratchet audits fail on Windows path and resource assumptions #7878

Description

@proggeramlug

Summary

Three lightweight GC/performance audit commands fail on a supported Windows development host before they can evaluate repository state:

python scripts/gc_runtime_root_holders.py --self-test   # exit 1
python scripts/gc_runtime_root_holders.py               # exit 1
python scripts/check_thread_locals.py                    # exit 1
python benchmarks/gc_ratchet/gc_ratchet.py validate --scope structural
# ModuleNotFoundError: No module named 'resource'

The first two scanners build repository-relative keys with str(Path.relative_to(...)), which produces backslashes on Windows. Their checked-in inventories/allowlists and synthetic self-test expectations use forward-slash repository paths. Consequently every real declaration appears new and every checked-in entry appears stale; the root-holder self-test also reports every planted fixture as missed.

gc_ratchet.py imports the Unix-only resource module at module import time even though it is unused (peak RSS uses os.wait4) and validate --scope structural does not launch a measured process. Structural artifact validation should not require a Unix process API.

Impact

  • Windows developers cannot run two fast gates that protect GC root coverage and hot-TLS policy.
  • The ratchet's cheap structural validation cannot run before a heavy build on Windows, despite the harness explicitly separating platform-independent validation from measurement.
  • This makes local preflight weaker on a platform Perry advertises and runs in GC native-root CI.

Evidence

Acceptance criteria

  • Normalize all repository-relative identity keys with Path.as_posix() (including call-graph/module-edge keys and synthetic fixture expectations).
  • Both scanners' --self-test and live verify modes pass on Windows and Unix.
  • Remove the unused resource import or defer any genuinely Unix-only import to the measurement path with a clear platform refusal.
  • gc_ratchet.py validate --scope structural and harness unit tests run on Windows without compiling Perry.
  • Add a Windows CI step for these structural/self-test commands; it should not run the heavy ratchet measurement.

Metadata

Metadata

Assignees

Labels

bugConfirmed defect or regressiontoolingDeveloper tooling, CI, tests, or release infrastructure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions