Skip to content

feat: add env record with host/NUMA/affinity for reproducibility#31

Merged
btraven00 merged 1 commit into
mainfrom
feat/numa-env-record
May 14, 2026
Merged

feat: add env record with host/NUMA/affinity for reproducibility#31
btraven00 merged 1 commit into
mainfrom
feat/numa-env-record

Conversation

@btraven00
Copy link
Copy Markdown
Owner

Adds a one-shot env record at the head of JSONL output capturing host, kernel, CPU topology, NUMA distances/sizes, inherited CPU affinity, and reproducibility-critical knobs (governor, frequency, THP, SMT, cgroup). Enables comparing benchmark runs across machines or affinity settings without external bookkeeping.

Schema: every record now carries a "kind" discriminator (env, metadata, sample, tree) via an internally-tagged enum. Legacy untagged files remain readable via a fallback path in the file reader, so existing stats/summary workflows are unaffected.

  • new EnvRecord collector reads /proc/cpuinfo, /sys/devices/system/cpu/, /sys/devices/system/node/, sched_getaffinity, and cpufreq/THP/SMT/cgroup
  • new Record enum and tagged_json() helper in src/monitor/record.rs
  • CLI: --write-env flag in src/bin/denet.rs
  • Python: write_env kwarg and monitor.get_env() in src/python.rs
  • ProcessMonitor::get_env() exposed for direct use
  • Reader updated to try tagged Record first, fall back to untagged
  • 13 new tests covering parsers, range compression, Record roundtrip, back-compat with untagged lines, and a Linux smoke test
  • Documented in docs/data-format.md and docs/python-api.md

@btraven00 btraven00 force-pushed the feat/numa-env-record branch 3 times, most recently from ecafafb to 86d982b Compare May 14, 2026 18:12
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/monitor/env.rs 96.48% 12 Missing ⚠️
src/monitor/record.rs 94.06% 7 Missing ⚠️
src/core/process_monitor.rs 96.55% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Adds a one-shot env record at the head of JSONL output capturing host,
kernel, CPU topology, NUMA distances/sizes, inherited CPU affinity, and
reproducibility-critical knobs (governor, frequency, THP, SMT, cgroup).
Enables comparing benchmark runs across machines or affinity settings
without external bookkeeping.

Schema: every record now carries a "kind" discriminator (env, metadata,
sample, tree) via an internally-tagged enum. Legacy untagged files
remain readable via a fallback path in the file reader, so existing
stats/summary workflows are unaffected.

- new EnvRecord collector reads /proc/cpuinfo, /sys/devices/system/cpu/*,
  /sys/devices/system/node/*, sched_getaffinity, and cpufreq/THP/SMT/cgroup
- new Record enum and tagged_json() helper in src/monitor/record.rs
- CLI: --write-env flag in src/bin/denet.rs
- Python: write_env kwarg and monitor.get_env() in src/python.rs
- ProcessMonitor::get_env() exposed for direct use
- Reader updated to try tagged Record first, fall back to untagged
- 13 new tests covering parsers, range compression, Record roundtrip,
  back-compat with untagged lines, and a Linux smoke test
- Documented in docs/data-format.md and docs/python-api.md
@btraven00 btraven00 force-pushed the feat/numa-env-record branch from 86d982b to 1ec28e1 Compare May 14, 2026 18:36
@btraven00 btraven00 merged commit bd497c0 into main May 14, 2026
13 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.

1 participant