Repository navigation
perf(research): compile the P112 ten-deletion census with popcnt (2.69x, byte-identical receipts) - #4090
Open
kumagi wants to merge 1 commit into
Open
perf(research): compile the P112 ten-deletion census with popcnt (2.69x, byte-identical receipts)#4090kumagi wants to merge 1 commit into
kumagi wants to merge 1 commit into
Conversation
Callgrind on the shipped -O3 binary shows 25.0% of all retired instructions inside libc __popcountdi2 calls: without a popcnt target feature every count(Mask) is an opaque out-of-line call, which also blocks loop vectorization around the census and deletable hot loops. The sibling packages research/p112-common-deletion-slice and research/p112-common-fourteen-cut already compile with -mpopcnt. Measured on the same host, same fixture, byte-identical stdout for both registered censuses and identical RESULT.json: full registered replay 155.94 s -> 57.91 s (census 8: 39.10 -> 15.00 s, census 10: 99.69 -> 43.67 s). No mathematical or output change.
This was referenced Oct 20, 2026
Draft
Contributor
|
Independent scoped check of #4090 P112 ten-deletion popcnt compile flag at Scoped perf change only ( What passes:
Not covered: re-timing the 2.69× claim on this machine; full package rebuild/receipt replay (out of this one-line scope). Byte-identical receipts were not re-run here. James Reed (@rcfc-jreed), with substantial AI assistance (Claude, in Cursor). |
This was referenced Oct 21, 2026
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One-line verifier change: compile
research/p112-ten-deletion-span/census.cppwith-mpopcnt.The shipped
-O3build compiles for baseline x86-64 without aPOPCNTtarget feature, so everycount(Mask)lowers to an opaque out-of-line call to libc__popcountdi2. Callgrind on a 5-rep budget-8 run attributes 25.04% of all retired instructions to that call, and hiding it inside a function boundary also blocks loop vectorization around the census /deletablehot loops. The sibling packagesresearch/p112-common-deletion-sliceandresearch/p112-common-fourteen-cut(same PR3161 descent) already compile with-mpopcnt; this successor dropped it.Measured result
Same host (32-core Linux, gcc 15), same fixture, same interpreter, back-to-back builds differing only in the flag:
census FIXTURE 8census FIXTURE 10verify.py --work)cmpof the retained diagnostics), and the registered replay passes unchanged (PASS_P112_TEN_DELETION_SPAN span=4 beta_5_4_remaining=2, receipt compared toRESULT.jsoninsideverify.py, no--output).scripts/research_package.py --check-onlyPASS; registered command 2 (test_verify.py,-O -Werror) PASS.mpopcntis available on the committed replay hardware (the dedicated workflow runs onlyubuntu-latestGH runners); outputs are unaffected because popcount semantics are target-independent.Scope
research/p112-ten-deletion-span/verify.pyonly (+1 line inFLAGS). No census source change, no mathematical claim, no receipt, no other package.Cross-references the measured handoff in #1166.