docs(cpu_features): record baseline instruction counts and AVX1/SSE4.2 host delta #2188
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2188"
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?
Imported from ubiquitarianism/leonida. Originally posted by robot00f on 2026-11-26T03:41:32Z.
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)
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T23:33:02Z.
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.
Imported from ubiquitarianism/leonida. Originally posted by timbot103 on 2026-11-29T04:28:48Z.
Review: COMMENTED
Static review of
c59ae5ed6againstb6bf3aa0b. No tests, builds, or GPU runs were performed. All 14 baseline rows reconcile with their inside and outside.pdatacounts, and the AVX bucket corrections and instruction subtotals add up. The scanner revision resolves, the change introduces no PR references, and the table structure, tracked paths, encoding, and file contents match the repository’s documentation and file checks. The underlying instruction census was outside the scope of this static review.docs/cpu_features.md:102— Please label the fault list as the behavior of unpatched instructions and make F16C conditional on its CPUID bit.runtime/src/pe_loader.cppalready rewrites eligible sites, andruntime/src/bmi_emulation.hroutes discovered shortTZCNTandLZCNTsites throughUD2. A short description of those paths and the exception fallback would bring the runtime section in line with main.docs/cpu_features.md:48— Please add the method used for the register-source, encoding-length, and carry-consumer counts.tools/cpu_feature_scan.pyreports baseline totals, andtools/inline_scan.pyrequests disassembly without instruction bytes. The listed commands cannot reproduce those site-level details on their own.AI-assisted.
Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T17:12:49Z.
Tested
c59ae5ed6merged (no commit) with main0bc6e21a1: 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).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T19:52:57Z.
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 atcfd12b24f), PR headc59ae5ed6: docs only, doc tests greentests/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
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T20:06:44Z.
"No game data" review by OreoFR (requested for maintainers), PR head
c59ae5ed6, merged locally on main720bd3b4e: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
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:01:22Z.
Review: APPROVED
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.)