os: Processor.describe on Arm64 Linux and macOS (OS slice 3, step 2c of #127) #786
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#786
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Step 2c of #127 (OS slice 3):
Processor.describe()on Arm64 Linux and Arm64 macOS answersOkwith vendor, model, caches and features, replacing theUnsupportedarms of those two halves. Arm64 Windows staysUnsupporteduntil step 2d.Why the cut: the Arm64 description needs three system sources, a cache source per system (Linux
/sys/devices/system/cpu/cpu0/cache/, macOShw.l1dcachesizeand siblings, Windows a newprocessorTopologynative overGetLogicalProcessorInformationEx) and an uncompiled-here Windows C file. Linux and macOS use onlystd/osreads that exist or are one small native (getauxval), so they fit one PR; Windows follows as 2d. Only 2c is filed now, per the definition of ready.Design record
docs/design/OS.mdsection 5.2 (ProcessorDescription,ProcessorFeaturewithNeon,Crc32,DotProduct,Sve,Sve2,Aes,Sha), section 7 "Linux" and "macOS" native tables (auxiliaryValue,Bsd.sysctl*by name,hw.optional.arm.*,/proc/cpuinfo), the "As built (step 2b)" note, slice 3 of section 10.Scope
Processor.describe(): in the.Linuxand.MacOsarms, anArchitecture.current.Arm64arm that callsdescribeArm64(...)of the per-system half;.Windowsand every other architecture keep answeringOsError.Unsupported("the processor description", ...).vendorfrom theCPU implementerfield of/proc/cpuinfo(a pure parser with a table of the common implementer codes:0x41ARM,0x61Apple,0x51Qualcomm,0x46Fujitsu,0xc0Ampere; unknown code:ARM),modelfrommodel nameorHardware, else the vendor; features fromgetauxval(AT_HWCAP)andAT_HWCAP2(Neon=asimd,Aes,Sha=sha1andsha2,Crc32,DotProduct=asimddp,Sve,Sve2) through a pure decoder over two integers; caches from/sys/devices/system/cpu/cpu0/cache/index*/(level,type,size,coherency_line_size) through a pure parser. Adds the nativeauxiliaryValue(kind: Int): Int64toruntime/os/linux.conly if step 2a or 1 did not already; it is plainDirect, no outcome.vendorApple,modelfrommachdep.cpu.brand_string, features fromhw.optional.arm.*(FEAT_AES,FEAT_SHA256,FEAT_CRC32,FEAT_DotProd,AdvSIMD; SVE isfalseon every Apple processor to date), caches fromhw.l1dcachesize,hw.l1icachesize,hw.l2cachesizeandhw.cachelinesize, all throughBsd.sysctl*by name; a name the system does not know reads as absent, never as an error.packageson Arm64 Linux and macOS reuse the 2b functions (parsePackageCount,hw.packages), with1where they answer 0.baseFrequencyandmaximumFrequencystayNone(step 3).std/os/tests/processor.test.trb: the implementer parser and the cache parser on captured/proc/cpuinfoand/systexts of one Apple-Silicon Asahi Linux, one Graviton (Neoverse) and one x86 file (answers none); the hwcap decoder on made-up words with and without SVE; one machine-tolerantdescribetest that runs on the Arm64 CI machines only if one exists, otherwise on--every-targettype checking.docs/standard-library/os.mdand theskills/copy updated; the "As built" note of OS.md section 7 and the slice 3 row of section 10 say what 2c did and that Windows Arm64 is 2d.ProcessorFeaturecases.Acceptance criteria
Processor.describe()answersOkwith non-emptyvendorandmodel,logicalProcessors == Processor.logicalCount(),physicalCores == Processor.physicalCount(),featurescontainingNeon, and at least one cache; where no Arm64 machine runs CI the same is checked by the pure parsers fed with captured texts.OsError.Unsupported;torb check --every-targetshows no compile error on any target.0x41,0x61,0x51,0xc0to their vendor names and an unknown or missing code toARM; the hwcap decoder returnsSveandSve2only when their bits are set; the cache parser handles missing files and an empty text without trapping.torb format --checkclean on touched files;sh tools/gates.sh agreen in forge CI; docs check andskills/regeneration clean.Seed impact
None expected: new std names and, at most, one plain
Directnative inruntime/os/linux.cthat the compiler does not look up by string. If CI shows otherwise, fall back to the two-commit rule.Size
One PR, two Conventional Commits:
feat(os): Arm64 feature and cache readers for Linux and macOS(natives if needed, pure parsers, tests) andfeat(os): Processor.describe on Arm64 Linux and macOS(wiring, docs).Dependencies
Step 2b (#543) landed (
28ac17d5), 2a (#538) and step 1 (#488) landed. Part of #127; 2d (Arm64 Windows) and step 3 (frequencies) are not filed yet.[loop:torbscript] claim implement by session:loop-torbscript-20261114-1708 until 2026-11-14T22:08:00Z
[loop:torbscript] implement: opened #789 (2 commits: Arm64 readers + natives/tests, then the describe wiring + docs; verified: only commit format via tools/check-commits.sh, the diff read through; unverified until CI: torb check --every-target, format, tests, hand-edited machine_natives.c/torb_natives.h/NATIVES.md and the skills/ copy, seed gate). next: waiting (CI on the PR, then review)
[loop:torbscript] release implement by session:loop-torbscript-20261114-1708
[loop:torbscript] claim implement by session:loop-torbscript-20261114-1932 until 2026-11-14T22:32:00Z
[loop:torbscript] implement: PR #789 history rewritten so the
stylecommit is folded into "feat(os): Arm64 feature and cache readers for Linux and macOS" (fixup); two valid Conventional Commits remain, new head5d8feef0(was0e10e534), force-pushed with --force-with-lease. Verified locally:git diff 0e10e534 HEADis empty (tree identical),sh tools/check-commits.sh 74605bb2 HEADpasses. Unverified until CI: all checks (commit messages, what the change touches, gates, pdisc were pending right after the push). next: waiting (CI on the PR, then review)[loop:torbscript] release implement by session:loop-torbscript-20261114-1932
[orion] status: PR #789 (Processor.describe on Arm64 Linux and macOS) was merged by argus as
40bd5cabf. Post-merge steps are complete: the PR has no 'After merge' section and the repo has no x.y.z release tags (only nightly-YYYYMMDD tags), so no release was cut. Main CI on40bd5cabfwas still pending (ci gates, commit messages, what the change touches, pdisc, site:edge) after a 10 minute wait, so CI is not verified green. Next step: check the commit status on40bd5cabfand file a follow-up if a gate fails.