Skip to content

fix(node:os): return CPU info shape - #1897

Merged
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-os-cpus-shape
May 27, 2026
Merged

fix(node:os): return CPU info shape#1897
proggeramlug merged 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-os-cpus-shape

Conversation

@andrewtdiz

@andrewtdiz andrewtdiz commented May 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace the empty os.cpus() runtime stub with Node-shaped CPU info objects
  • populate model, speed, and nested times.{user,nice,sys,idle,irq} fields
  • use Linux /proc/cpufreq data when available and a shape-compatible available-parallelism fallback elsewhere

Before

  • ./run_parity_tests.sh --suite node-suite --module os --filter loadavg-and-cpus-shape failed because Perry returned an empty os.cpus() array, so the first CPU field-shape line was missing.

Verification

  • cargo fmt --all --check
  • cargo check -p perry-runtime
  • ./scripts/check_file_size.sh
  • ./scripts/regen_api_docs.sh (no docs diff)
  • git diff --check
  • ./run_parity_tests.sh --suite node-suite --module os --filter loadavg-and-cpus-shape
  • ./run_parity_tests.sh --suite node-suite --module os --filter cpus (2/2 pass)
  • ./run_parity_tests.sh --suite node-suite --module os --filter platform (5/5 pass)
  • ./run_parity_tests.sh --suite node-suite --module os (34 pass / 5 unrelated fail)

Reference

Non-goals

Closes #793
Refs #800

@proggeramlug
proggeramlug merged commit a888969 into PerryTS:main May 27, 2026
10 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.

Roadmap: Node.js + TypeScript compatibility & stability

2 participants