feat(os): Processor.describe and ProcessorDescription on x86-64 #545
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/543-processor-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?
Closes #543
Step 2b of #127 (OS slice 3):
Processor.describe()andProcessorDescriptionon x86-64 Windows, Linux and macOS, assembled from the decoders of #538 and the system's own counts.What
feat(os): processor package counts per system:packageCount()per half (Windows fromprocessorCounts, macOSsysctl hw.packages, LinuxparsePackageCountover/proc/cpuinfo: distinctphysical idvalues, 1 where none is named, never traps on an empty text) and their tests.feat(os): Processor.describe and ProcessorDescription on x86-64:ProcessorDescription(with Show, Equals),Processor.describe()(amatch OperatingSystem.current;Unsupportedfor FreeBSD, the browser and every non-x86-64 architecture until 2c), the pure compositionCpuidDump.describe(logicalProcessors, physicalCores, packages)(the system's counts win over the dump's topology, brand trimmed, empty brand falls back to the vendor, apackagesbelow 1 falls back toCpuidTopology.packagesOf), tests,docs/standard-library/os.md, OS.md section 7 ("As built, step 2b") and the slice 3 row of section 10, regeneratedskills/.baseFrequencyandmaximumFrequencyareNone(step 3). No native, no syntax change, no std name the compiler looks up by string: no seed impact expected.Test
Locally only (installed nightly
nightly-20261027, which predates thecpuidnatives of #538, so the native-backed tests cannot run there):torb format --check std/os(0 of 60 would change),torb check std/os(60 files, no problems),torb test std/os/tests/processor.test.trb(28 passed),torb test std/os/tests/x86.test.trbagainst a scratch copy withCpuidDump.readstubbed (35 passed, including the newdescribegroup),torb docs skill docs skills --check,torb docs declarations docs --checkandtorb docs check docs --no-snippetsclean,sh tools/check-commits.sh origin/main HEADclean. The on-machine test (host.test.trb, "the description of an x86-64 machine ...") andsh tools/gates.sh arun in the forge CI only.CI red on
88a18c7: ci / tier A (linux-x64) (gates.sh a,docs checkanddoc --check --no-run std) - cause seen in the job log:docs/standard-library/os.md:407and theProcessor.describeexample atstd/os/src/processor.trb:141writeprocessor.features.contains ProcessorFeature.Avx2(inside the"{...}"interpolation in os.md, and as a bareprintargument in the doc comment). The docs check rejects both ("Expected}after the expression" / "containsis a method, and this shows the method instead of its answer"). Call it with parentheses,contains(ProcessorFeature.Avx2), in both places, and regenerateskills/so the copy inskills/.../os.mdmatches. Rest of the diff read: no other blockers found.Fixed in
16d214d:features.contains(ProcessorFeature.Avx2)with parentheses in docs/standard-library/os.md, theProcessor.describeexample and theProcessor.featuresexample in std/os/src/processor.trb, and the same line in the skills/ copy (edited identically; the generated copy differs from docs/ only in link rewriting, and this line is untouched by that). Re-requesting review; CI will confirm the docs gate.CI red on
16d214d: ci / tier A (linux-x64) (gates.sh a,doc --check --no-run std) - cause seen in the job log:std/os/src/processor.trb:384, the example ofProcessorFeature: "A call is a command wherever the grammar allows it. Writefeatures.contains ...without parentheses". Thefn wideKernelsAreSafebody ends infeatures.contains(ProcessorFeature.Avx2)as a plain expression statement, which the docs check wants in command form (features.contains ProcessorFeature.Avx2); the parenthesised form is only right where the call is an argument or inside"{...}"(the two places fixed in16d214d). It is the only problem reported (1 problem, 337 examples checked); check the othercontains(examples the last commit touched for the same split.Not mergeable on
16d214d: the branch is 13 commits behind main (6a8bb01) and Forgejo reports a conflict; rebase onto main. Rebase and fix together so one CI run covers both. No other blockers found in the diff read so far; the next CI run brings me back.16d214ddda1981fd6477Fixed in
1981fd6: rebased onto main (13 commits; one conflict in theuse ... from "std/os"import lines of docs/standard-library/os.md and its skills/ copy, resolved by keeping bothUserandProcessorDescription), and theProcessorFeatureexample in std/os/src/processor.trb:384 is back to command form (features.contains ProcessorFeature.Avx2) as a plain statement. The othercontains(uses (the"{...}"interpolation in os.md and theprintargument in theProcessor.describeexample) are argument positions and stay parenthesised. Re-requesting review.Approved on
1981fd6.CpuidDump.describecovered with captured dumps (Intel, AMD with/without AVX-512, padded brand, no brand, hybrid counts, packages fallback, empty dump);parsePackageCountcovered (one/two sockets, nophysical id, empty); on-machine test in host.test.trb. CI green for this head (tier A, gates, pdisc, commit messages).packages < 1->CpuidTopology.packagesOf; Unsupported for FreeBSD, browser and non-x86-64./proc/cpuinfoandsysctl hw.packagesonly.containscommand vs call form) and the rebase are resolved.Non-blocking: none.
Merge failed on
1981fd6(approved in review 515):POST /pulls/545/merge(Do=rebase, head_commit_id=1981fd6, delete_branch_after_merge) answered HTTP 405Please try again later. PR is still open and mergeable=true per the API; not retrying. Merge needs to be re-triggered once Forgejo accepts it.Merge failure on
1981fd6was a transient Forgejo 405 ("Please try again later"); PR is open, mergeable=true, head unchanged and approved in review 515. Re-requested review from argus so the merge can be retried.Approved on
1981fd6(confirms review 515; re-submitted because the re-requested review made 515 non-official and the merge answered "Does not have enough approvals").Non-blocking: none.