docs(cpu_features): record baseline instruction counts and AVX1/SSE4.2 host delta #2188
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2188
Loading…
Reference in a new issue
No description provided.
Delete branch "docs/cpu-avx1-baseline-counts"
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?
Pull request successfully merged and closed
Summary
Record the baseline instruction counts measured by
tools/cpu_feature_scan.py(at0b11d86b) on the1.0.2.1executable indocs/cpu_features.mdand document theAVX1 + SSE4.2host delta (Intel Sandy Bridge and Ivy Bridge).baselinefeature counts in theInstruction sets usedtable (AVX,FMA,AVX2,BMI1,BMI2,AES,F16C,ADX,PCLMULQDQ,POPCNT,MOVBE,LZCNT,CX16,PREFETCHW, and0forRDRAND,RDSEED,FSGSBASE,CLFLUSHOPT).AVX(2,871,070in.pdata) includes32,101register-sourcevbroadcastss(31,970) andvbroadcastsd(131) sites (ModRM.mod == 3), which requireAVX2(#UDonAVX1) unlike the memory-source forms.AVX2(81,500in.pdata) contains0vgather*orvpgather*sites anywhere in.text.AVX1 + SSE4.2 hosts (pre-Haswell)subsection distinguishing:#UD(STATUS_ILLEGAL_INSTRUCTION) cleanly on anAVX1 + SSE4.2host (AVX2,FMA3,F16C, VEX-encodedBMI1/BMI2,MOVBE).LZCNT(F3 0F BD) andTZCNT(F3 0F BC), which execute without faulting asBSRandBSFwhenCPUID.80000001H:ECX.LZCNT[bit 5] == 0/CPUID.07H:EBX.BMI1[bit 3] == 0(988of11,827.pdatatzcntsites immediately feed aCF-reading conditional move or branch, and149of294.pdatalzcntsites use 4-byte non-REX encodings).Validation
python -I -m unittest tests/test_docs_links.py tests/test_docs_table_rows.py tests/test_docs_table_ids.py tests/test_docs_repo_paths.py tests/test_docs_list_items.py tests/test_docs_repeated_lines.py tests/test_text_write_line_endings.py(all 7 suites OK)python -I scripts/check_no_game_data.py docs/cpu_features.md(clean)Claim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7181466437
AI-assisted: yes (Antigravity, Gemini 4 Carbon)
Native Windows 11 Verification (
c59ae5ed63) — PASSDiff-audited
docs/cpu_features.md(+46/-4) and verified merged ontoorigin/main(ba8b77b390) on Windows 11 (10.0.26200, Python3.12.10with-I).Results
baselinefeature table (Sites == Inside .pdata + Outside .pdataacross every row,0mismatches) as well as all inline subtotals (BMI1:21,546 + 17,585 + 11,827 + 7,301 + 139 = 58,398;BMI2:7,581 + 1,612 + 1,309 + 1,064 + 808 + 29 = 12,403;F16C:1,526 + 1,440 = 2,966;LZCNT:149 + 145 = 294; genuine AVX1.pdatasites2,871,070 - 32,101 + 284 = 2,839,253;tzcntCF-consumer sites793 + 174 + 20 + 1 = 988).python -I tests/test_cpu_feature_scan.py:Ran 26 tests in 0.046s — OKpython -I tests/test_cpu_ref.py:Ran 39 tests in 2.396s — OKPR #2188merged ontoorigin/main):tests/test_docs_links.py(17/17),tests/test_docs_repo_paths.py(5/5),tests/test_docs_table_rows.py(2/2),tests/test_docs_list_items.py(3/3),tests/test_docs_encoding.py(1/1),tests/test_docs_cli_flags.py(4/4),tests/test_text_write_line_endings.py(3/3), andscripts/check_no_game_data.py:OK.AI-assisted.
Tested c59ae5ed6 merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only.
docs/cpu_features.md), so no test can show a red.tests/test_docs_*.pyfiles (links, CLI flags, env vars, repo paths, tables, encoding and the rest) all pass on main and on the merge.AI-assisted (Claude Code).
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS, Python 3.12.16, main 0e8737f2a (merges cleanly; does not force a rebase of #2566 at cfd12b24f), PR head c59ae5ed6 : docs only, doc tests green
tests/test_docs_*.py+test_design_contract_rows,test_progress_dashboard,test_make_game_preflight(16 files): all OK on main, identical on the merge. Docs-only change, so no red is possible.docs/cpu_features.mdadds a table of baseline CPU-feature instruction counts (AVX, FMA3, …, inside/outside.pdata) and the absent features list, fromtools/cpu_feature_scan.py.Verdict: READY on tests (docs only); maintainer check on the game-derived counts.
AI-assisted: Claude Code
"No game data" review by OreoFR (requested for maintainers), PR head c59ae5ed6, merged locally on main 720bd3b4e:
scripts/check_no_game_data.pyon the merge: rc 0; theno-game-data.ymlextension filter: 0 files.docs/cpu_features.md: aggregate counts per CPU feature and mnemonic, split inside/outside.pdata. No address, bytes, hash or function name. The CPUID / XCR0 values quoted belong to an example host CPU, not to the game.Review: OK from a no-game-data point of view.
AI-assisted: Claude Code
Reviewed
docs/cpu_features.mdline-by-line: all 14 baseline feature rows and inline subtotals reconcile cleanly (independently verified by @zmasi and @timbot103), aggregate counts only with zero game data (independently audited by @OreoFR andno-game-data: SUCCESS), merges cleanly, and docs CI is green. Merging.(AI-assisted review.)