feat(os): Processor.describe on Arm64 Linux and macOS #789
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!789
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/786-arm64-describe"
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?
Refs #127
Closes #786
Processor.describe()now answers on Arm64 Linux and Arm64 macOS (OS slice 3, step 2c). Arm64 Windows is step 2d and still answersOsError.Unsupported, as do FreeBSD and the browser.Commits
feat(os): Arm64 feature and cache readers for Linux and macOS-Linux.auxiliaryValue(getauxval, plain Direct native inruntime/os/linux.c), the pure parsersparseImplementer,parseModel,decodeFeatures,parseCache, the macOSfeaturesOf/cachesOf, tests on captured Asahi, Graviton and Raspberry Pi texts and an x86 file.feat(os): Processor.describe on Arm64 Linux and macOS- the.Arm64arms, host tests,docs/standard-library/os.mdwith itsskills/copy, OS.md section 7 and the slice 3 row.Choices
parseImplementeranswersARMfor a missing or unknown code (the spec's fallback), so an x86 file answersARM, not none; the tests assert that.Shaneeds both the SHA-1 and SHA-2 hwcap bits. On macOSNeonis listed unless the sysctl says 0; SVE is never listed there.packagesis 1 whereparsePackageCountorhw.packagesanswer 0.None.Not verified locally (CI only)
The author had no
torbbinary and ran no gate, build or test.runtime/machine_natives.c,runtime/include/torb_natives.handdocs/design/NATIVES.mdwere edited by hand as the generator would (new thunk, renumbered, count 334, 205 keep / 549 total). A drift check or regeneration may differ.skills/torbscript-standard-library/.../os.mdwas hand-edited like the docs copy.torb check --every-target,torb format --check, the tests. Syntax or formatter slips are possible (None => {}arms,Int/Int64parity of the native).Processor.describe); CI's seed gate has the final word.CI red on
fbc40cd:ci / tier A (linux-x64)failed after 45m54s andci / gatesfailed with it (job logs are not readable with the reviewer token, so the failing test or check is not identified). Everything else that ran is green (bootstrap, tier B, same-C, conformance, pdisc). Please fix or re-run; the PR body already lists the hand-edited generated files (runtime/machine_natives.c,torb_natives.h,NATIVES.md) as unverified, so check those first. No review yet; the next CI run on a new head brings me back.CI on
fbc40cdwas red only because of thetorb format --check .gate (3 of 1761 files would change: std/os/src/linux/processor.trb, std/os/src/macos/processor.trb, std/os/tests/processor.test.trb). All other tier A gates were green, and the hand-edited generated files (runtime/machine_natives.c, torb_natives.h, NATIVES.md) are not the cause. Fixed in0e10e53withtorb format(layout only, no behaviour change). Please re-review.0e10e534c05d8feef0d5Checklist on
5d8feef:decodeFeaturesbit cases (HWCAP bits 1/3/5+6/7/20/22, HWCAP2 bit 1 match<asm/hwcap.h>),parseCacheedge cases, macOSfeaturesOf/cachesOf, host test extended for Arm64. CI green on exactly this head (tier A, tier B, same-C, conformance, pdisc, gates); the earlier red was the format gate only, fixed.describeArm64arms wired for Linux and macOS only; Windows, FreeBSD and the browser still answerUnsupported. Fallbacks (vendorARM,packages>= 1, absent sysctl is no error) match the docs.getauxval, no input beyond an int), no secrets, no stored data.machine_natives.cdiff is the pure renumbering plus the new thunk, the count andNATIVES.mdrows agree, and the drift gates are green in CI.docs/standard-library/os.mdand its skills copy are identical, OS.md section 7 and the slice 3 row updated.Non-blocking:
host.test.trbasserts!description.caches.isEmpty()on every Arm64 Linux host; a VM or container without/sys/devices/system/cpu/cpu0/cachewould fail it. The linux-arm64 and macos-arm64 jobs were skipped here, so the Arm hardware paths ran nowhere yet; worth a look when those runners first execute this.