…es overlapping
Each square's index was shifted by a count loaded from a per square
array, and at x86-64-v2 that shift goes through cl. Every straight index
is now read at twelve bits and every diagonal one at nine, so the shift
is a constant and the shift array goes.
A fixed width alone needs a block of 4,096 slots a square, 2 MiB for the
straight table, and that was measured before: fewer instructions, but
last level misses up a third. At the fixed width most of a square's
slots are empty, so here the blocks overlap. Each square starts at an
offset chosen so its slots land on slots no other square uses, or on
one holding the same attack set. The tables reach 114,947 and 5,423
entries (940 KiB, against 841 KiB before) and stay in the same power of
two arrays, so the probe keeps its mask and carries no bounds check.
The magics and offsets are new. The test side search now places them,
widest mask first, greedily, from the same generator and seed, and
const evaluation still checks every configuration as it builds the
table.
Under cachegrind, against f424675 and with the last level set to one
core's L2: the games suite -0.577% of instructions with last level read
misses -0.85%, the bench -0.786%. The fixed shift without the overlap
read -0.188%, +3.34% and -0.277%.
The clock on a shared four core machine could not resolve it either way:
+2.2% (+0.4% to +4.4%) over 15 rounds and -0.7% (-3.2% to +1.5%) over 60.
The trailer is the 60.
Bench: 11088536
Speed: -0.7% (bench nps, 95% interval -3.2% to +1.5%, 60 interleaved rounds over shuffled layouts vs f424675)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018YMhHrVdXrSLCTea5LmtbH
Every straight magic is read at twelve bits and every diagonal one at nine, so the probe shifts by a constant rather than by a count loaded from a per square array (which at x86-64-v2 goes through
cl). The squares' tables overlap in one array at per square offsets, so the fixed width costs 940 KiB rather than the 2.25 MiB a block of slots a square would take (841 KiB before). The index mask stays, so the probe still carries no bounds check.The magics and offsets are new and still built at compile time. The test side search places them greedily from the same generator and seed, and
regenerate_magicsreproduces the committed constants. Const evaluation checks every configuration as it fills the table.Against f424675, nodes identical on both suites:
Misses are cachegrind's with the last level set to one core's L2 (
--LL=2097152,16,64).speed.shon a shared four core machine could not resolve it either way (-0.7%, -3.2% to +1.5%, over 60 rounds). Eight timing runs at 10+0.1 and a non-regression sprt [-10, 0] are to follow.The release, debug, tactical and strategic suites pass, as does clippy.
🤖 Generated with Claude Code
https://claude.ai/code/session_018YMhHrVdXrSLCTea5LmtbH
Generated by Claude Code