71 Commits
Author SHA1 Message Date
Stefan Wessels ba3f8a4ec9 Add native SDL2 desktop port with C64 graphics 2026-10-18 17:03:11 -07:00
Stefan Wessels 500afb3e89 Docs: list the Amiga 500 port.
The public lists still stopped at the MEGA65. README, the recipe index, the seed table, the journal and the constraint notes now name the A500.
2026-10-12 21:31:08 -07:00
Stefan Wessels 72e6e7f01b Measure A3010 search performance against native MEGA65 2026-10-12 10:37:42 -07:00
Stefan Wessels fd7bca9fa1 Add native MEGA65 port and measured search benchmark 2026-10-12 10:27:29 -07:00
Stefan Wessels 4de42f63f1 Add ArchieSDK Acorn Archimedes chess port 2026-10-10 01:16:38 -07:00
Stefan Wessels 360d301520 a2m-v2 emulator is now a2m 2026-08-19 03:04:46 -07:00
Stefan Wessels 32da876f7e Docs: list the Macintosh 68k port.
The opening is no longer "1 MHz 8-bit machines."  Origin, then the faster
6502s, then the ports cc65 does not cover.  Seed table and platform count
match.
2026-08-15 23:20:46 -07:00
Stefan Wessels dac9c26b06 Docs: stop showing optspeed as the way to build.
optsize is the setting; the examples now match the uniformity rule.
2026-08-15 19:47:22 -07:00
Stefan Wessels 09c47cb03a Split the build into ports and toolchains.
A port is no longer a cl65 -t name. GNU Make dispatches from make/ports
and make/toolchains, so Spectrum (z88dk) and the host term build sit next
to the cc65 targets. Products land in build/<port>/; make help / make list
show the verbs and which compilers this machine has. make apple2 po is one
invocation.
2026-08-15 18:50:07 -07:00
rumbledethumps c6a5869c63 add rp6502 2026-08-13 23:51:25 -07:00
Stefan WesselsandClaude Opus 5 befc005793 Docs: say what level 1 is aimed at, and what its one ply costs
The ladder table gives level 1 a rating; it never said who that rating is
for.  State the target explicitly - beat a rank amateur, lose to a seasoned
beginner - and tie it to the mechanism, since the line falls exactly where
the second ply would be: at 400 nodes level 1 plays a one-ply move, so
quiescence keeps it from dropping pieces to a capture and it still mates in
one 55 of 60, while anything needing a quiet move to arrange, including a
mate in one against itself, is invisible.  Found by losing a game to a
human at this level and asking why.

Also records the one place the label overpromises, which is time rather
than strength: 400 nodes is the fastest setting and still 11 seconds a move
on a stock C64, and the budget cannot be cut because 300 draws won endings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 22:28:15 -07:00
Stefan Wessels 318c05a1d9 Docs: describe HEAD; fold closed portfolios into the log.
Product docs no longer narrate the journey. Search and evaluation
candidates that were measured and stopped live at the end of the
rework log. Emulator how-tos move from scratch/ to recipes/.
2026-08-12 21:52:05 -07:00
Stefan Wessels 9af82a752e F5: reject aspiration windows; Phase F closed empty
Window 50 around the previous iteration, full window on either failure.
Same-depth completed iterations match baseline move and score. Level 1
spends 22% more nodes; level 4 saves 10% and changes thirteen moves.
That is the PVS shape again, below the floor. Default off.
2026-08-12 17:17:44 -07:00
Stefan Wessels be397c161c F4: reject 16-bit move cache after host instrument
Probe may only promote a stored move found in the generated list.
32-, 64- and 128-entry tables all produce real cutoff-first hits and
no measurable node saving. No target code. RAM size is still open;
the instrument says do not spend it.
2026-08-12 17:13:44 -07:00
Stefan Wessels 5a8de66ec6 F3: reject compact piece-to-destination history
A 6x64 saturating table, cleared every search. Switch-off is exact. The
switch on saves 3.55% of L3 nodes and 2.49% at L4, and changes ten L4
moves. Ordering is already near-minimal. Default off.
2026-08-12 17:09:37 -07:00
Stefan Wessels ae54666a09 F2: reject previous-iteration root-score ordering
Rank every previously searched root move, not only the winner. Switch-off
is exact. The switch on spends nodes at levels 1-3, saves 0.24% at level
4, and changes nine L4 moves. Compiling it on takes an Atari display-list
page. Default off.
2026-08-12 17:06:21 -07:00
Stefan Wessels 02823b612a F1: reject previous-iteration full PV follow
Carry the last completed PV and try it first while the new search stays
on that line. Switch-off is exact. The switch on saves 1.36% of L4
nodes, spends 0.41% more at L3, and changes two L4 moves. Compiling it
on overflows Atari and Apple II. Default off.
2026-08-12 17:03:26 -07:00
Stefan Wessels 154ee420c7 Docs: remeasure free space; Apple II MAIN is now tightest
Relinked all seven targets. Apple II has 852 bytes in MAIN and 2,025 in
BSS. Atari still has 1,387 below the framebuffer. The other rows had
drifted and are brought current.
2026-08-12 16:50:03 -07:00
Stefan Wessels 58a79ad2d1 Atari: move the undo ring into upper RAM
The 1,024-byte persistent ring now lives at $AF00-$B2FF, in the hole
between the GR.8 screen and the 2K stack. Other targets are unchanged.
Framebuffer headroom is 1,387 bytes. Verified under Altirra and on the ATR.
2026-08-12 16:40:44 -07:00
Stefan Wessels 11d39afe42 E3: reject queen-before-minors — dose 16 short of +2σ
Doses 0 / −16 / −48 were declared first. The eval-time scan of the ten
home squares links on Atari and takes a display-list page; incremental
make/unmake does not link. Dose 16 is +1.95σ against a same-day
control that matches the published ladder. Dose 48 is worse. Defaults
off.
2026-08-12 16:19:03 -07:00
Stefan Wessels 97aa2f3f38 E2: existing values already at the constrained minimum
One fit of the shipping constant family on positions the engine actually
reaches. book.epd even/odd openings are train and locked val, pawn stays
100, tables keep their shape. The freeze is bishop 325; val mse is noise.
A null is done, so no gauntlet and no shipping change.
2026-08-12 15:55:13 -07:00
Stefan Wessels a3e74f7ed8 Docs: Sargon L4 confirmation after the Harder budget raise
22-13-29 (57.0%) at 18,000 nodes, 33 openings, no fifty-move draws.
Previous 15,000-node pairing was 22-27-15 (46.1%) with a weak Black
side; Black is now 11-4-17. Confirmation, not a regression.
2026-08-12 15:20:13 -07:00
Stefan Wessels 6b2f08a3f4 Docs: same-day 15k/60k control and measured C64 Phase D times
Harder's +20 Elo is against today's 15,000-node binary, not the historical
ladder. Very Hard 65,000 is a wash. Middlegame L4 is 48 minutes at 65k.
2026-08-12 11:43:22 -07:00
Stefan Wessels b74f9f00aa Docs: Phase D budgets, C64 L1/L2 times, Harder/Very Hard ladder
Record the 400/1,200/18,000/65,000 split, the 11.0s/39.7s C64 means, and
the L3/L4 Stockfish rows. Harder is a real granted-node gain; Very Hard
is noise. Sargon L4 confirmation still running.
2026-08-12 11:26:40 -07:00
Stefan Wessels 24f9093523 Docs: record E portfolio results across engine notes
Update next-engine portfolio status and open order, engine appendix B,
measuring suite/mine_failures, next-search check-extension status,
Agents.md pointer, and strength.md E1 equal-time confirmation.
2026-08-12 10:25:12 -07:00
Stefan Wessels e29833d954 E6: failure-mining instrument and sample; close E portfolio note
Add mine_failures.py for first durable SF swings on our losses. Sample L3
gauntlet: queen moves lead. E2/E3 left open with that direction; E1/E4/E5
already rejected on measured gates.
2026-08-12 10:20:25 -07:00
Stefan Wessels 6ef438ae9c E5: reject check extension — hurts level-1 mates
One-ply extension when in check changes move order under fixed budgets,
drops mate-in-one at level 1 below the floor (11/12→10/12), and costs an
Atari display-list page. SEARCH_CHECK_EXT defaults off and compiles out.
2026-08-12 10:19:01 -07:00
Stefan Wessels 7a51ab788d E4: reject KBN drive for Atari size
Colour-aware corner drive converts at level 4's budget on the host but the
working C is hundreds of CODE bytes over Atari. Slim forms still overflow and
levels 1–3 stay at zero. Default EVAL_KBN_ON off; suite forces it for gates.
2026-08-12 10:16:25 -07:00
Stefan Wessels c7127b7dda E1: reject pawn structure for equal-time cost
Board-scan form fitted Atari (82 free when on) but host nodes are ~1.38x
dearer; equal-time self-play is 182-244-86 over 512. Equal nodes only
228-208-76. Default EVAL_PAWNSTRUCT_ON off and drop the bit from EVAL_ALL.
Native suite still forces the switch on so purpose tests stay live.
2026-08-12 10:07:55 -07:00
Stefan Wessels 15a8d00082 Close Phase C after C4/C5 screens
Zero page is fully used ($1A) on every measured target; only Atari has spare
beyond the runtime block, so no common ZP placement is available. Piece lists
remain low priority given the Phase 20 profile and C3's blocked capture path.

Phase C ends with C1–C3 rejected on measurement and C4–C5 deferred. Shipping
is still the Phase B engine.
2026-08-12 01:51:29 -07:00
Stefan Wessels a5a656deb4 Reject C3 dedicated capture generator for Atari size
A write-pointer capture/promotion generator without sc_capturesOnly branches
is exact (quiescence subsequence order) and saves 6.3% on the fixed C64
middlegame, but grows engine CODE by about 1 KB and overflows Atari MAIN by
921 bytes. Default ENGINE_DEDICATED_CAPTURES off; the native suite forces it
on so the order gate stays live. No ca65 kernel was started.
2026-08-12 01:50:31 -07:00
Stefan Wessels 27a7741c3a Reject C2 on-demand legality for Atari size
eng_LeavesInCheck is exact: whole-book identity, perft, fuzz and constructed
pin/ep/double-check cases all match the full attack walk. The slim unaligned
early-out form saves about 2.3% on the fixed C64 middlegame but still overflows
Atari MAIN by 149 bytes; a dedicated vacated-ray scan overflows by 661.

Default ENGINE_FAST_LEGAL off so shipping maps stay at Phase B. The native
suite forces the switch on so the candidate cannot go stale.
2026-08-12 01:45:19 -07:00
Stefan Wessels 1ac1016a85 Reject C1 fused score-and-first-select
Internal lists can place the best move during scoring and skip the first
pickBest scan, but root must not: randomisation and previous-iteration
priority rewrite scores afterwards and change later equal-score order.

The size-conscious form is slightly slower on the fixed C64 middlegame;
the faster duplicated body costs an Atari display-list page for 0.36%.
Keep SEARCH_SCORE_FIRST default off for reproduction only.
2026-08-12 01:28:33 -07:00
Stefan Wessels eae75c08f2 Close the remaining Phase B hash screens 2026-08-12 00:55:32 -07:00
Stefan Wessels 535c646265 Record the rejected B5 delta guards 2026-08-12 00:44:22 -07:00
Stefan Wessels a47fd3d23b Restore running state on search unmake 2026-08-12 00:33:24 -07:00
Stefan Wessels 4bfaf272d5 Skip position history in quiescence 2026-08-12 00:17:13 -07:00
Stefan Wessels f123315a8a Measure and reject the B1 repetition shortcut 2026-08-11 23:42:28 -07:00
Stefan Wessels 9b247e8460 Retain and refresh the C64 search profile 2026-08-11 23:25:13 -07:00
Stefan Wessels 1e5b442d68 Write the next engine improvement roadmap
Document the measured starting point, exact 6502 speed work, direct strength candidates, target-safe gates, memory options, TT reopening conditions, and the evidence keeping rejected ideas closed.
2026-08-11 21:55:51 -07:00
Stefan WesselsandClaude Opus 5 e4f6b5b47e Keep what Phase 19 measured about the hot path
The transposition table died on the cost of a 32-bit hash, but the number it
died on is the most useful thing anyone has measured about this engine's hot
path.  The 16-bit hash already costs about 9% a node on a real C64, and
widening that one field cost a further 15.3%.

Hash maintenance is therefore the largest single identified cost in the 6502
node, it exists only to serve repetition detection, and reducing a cost is not
subject to the exchange-rate problem that sank the four pruning candidates.
Recorded as the first place section 3b should look, so a failed experiment
leaves a lead rather than only an epitaph.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 21:23:09 -07:00
Stefan Wessels 700187e6b5 Reject TT at the 32-bit hash cost
On a C64 under VICE, widening the incremental key cost 16.3%, 20.8% and 14.4% at the three c64search budgets, 15.3% combined. Node counts matched exactly. Stop before table code or RAM policy; retain the shipping engine unchanged.
2026-08-11 21:20:53 -07:00
Stefan WesselsandClaude Opus 5 06c5eefc8d Price the transposition table properly before anyone starts it
The note said the expensive half was already paid for, because a position hash
is maintained for repetition detection.  It is - and it is 16 bits.

That is enough to scan a repetition ring, where a false match is rare and costs
a wrongly-scored draw.  It is not a transposition key: 65,536 keys against a
60,000-node search collides constantly, and the index eats most of the key, so
a 1,024-entry table has about 6 bits left to verify with - roughly one accepted
false hit in 64 probes, each returning a score and a move from an unrelated
position.

So the first cost is widening the hash to 32 bits, paid in eng_Make and
eng_Unmake on every target including those with no room for a table, and the
repetition ring doubles too.  Price that on a real 6502 before writing any
table code; it can kill the idea in an afternoon.

The second cost is the RAM, and at ~8 bytes an entry the Atari holds about 64
of them while the C64 holds a thousand.  Sizing per target means seven targets
playing different chess, which is a portfolio decision and not a search one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 21:04:09 -07:00
Stefan WesselsandClaude Opus 5 a83adcfa42 Rewrite the work note around what the portfolio disproved
The note's premise was mine and it was wrong.  It argued that because strength
here is a node budget, a technique that reaches deeper within the same budget
is a direct win, and it set a 20% node pre-gate on the arithmetic of 60 Elo a
doubling.  Null move saved 27% and 22% at the levels it targeted, cleared that
gate comfortably, and measured 0.04 sigma.

The error is the exchange rate.  60 Elo a doubling was measured by *granting*
the search more nodes, and those are spent at full fidelity.  Nodes removed by
pruning are removed on an assumption that is sometimes wrong, so the depth they
buy is worth less.  Saved nodes are not granted nodes, and only one of the two
has a measured rate against Elo.

The other three failures have a compatible cause: move ordering here is already
close to minimal at 2.28 moves a node before a cutoff, so there was very little
tree left for a pruning technique to take.

So the pre-gate stays, demoted to what it actually is - a floor for
measurability, which stopped three candidates for pennies - and the ordering of
the work changes.  A transposition table returns a search that finished rather
than an assumption, which is the one remaining candidate this result does not
discount, and it is also the one that needs RAM.  Node cost and then the
budgets are the lever with a measured rate, and that puts Very Easy back on the
table as a strength question rather than an ergonomic one.

The instruments and gates are kept as the agent left them, including
nodecompare.py and the Atari page price moved to the last gate.  The standing
authorisations are marked spent: the unattended Sargon permission was a one-off
and the next task asks again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 20:59:27 -07:00
Stefan Wessels 76034a0ab1 Finish the Sargon level 4 baseline 2026-08-11 19:33:53 -07:00
Stefan Wessels 84b97d60e7 Close null move at the strength gate 2026-08-11 17:27:53 -07:00
Stefan Wessels a3c13ab7c6 Close losing-capture skipping below the node bar
The conservative defended-capture test saved 12.77% at level 1 and 9.26% at level 3, with exact switch-off equivalence over 1,024 searches. One diagnostic dose that also skipped equal trades raised those cells only to 13.72% and 9.84%. The mechanism tops out below the roughly 20% gauntlet resolution threshold, so revert before target builds or matches.
2026-08-11 17:04:20 -07:00
Stefan Wessels bfe107e14e Close delta pruning at the node pre-gate
Switch-off matched all 1,024 book searches exactly. Conservative middlegame-only delta pruning saved 1.57% at level 1 and 3.16% at level 3, while levels 2 and 4 consumed slightly more of their fixed budgets. The best cell is far below the roughly 20% needed for the gauntlet to resolve, so revert before target builds or matches.
2026-08-11 17:02:16 -07:00
Stefan Wessels cbd447d283 Close PVS below the measurable threshold
Switch-off matched 2,048 UCI records across all four levels. PVS saved 5-6% at levels 3 and 4 but hurt the weak levels, exactly as the whole-book node screen predicted. That deep-level gain is roughly 5 Elo against an 18 Elo gauntlet resolution and is too small to justify the Atari page step. Record the page as a deferred portfolio price rather than a build failure, and add the mandatory 20% whole-book pre-gate.
2026-08-11 17:00:37 -07:00
Stefan WesselsandClaude Opus 5 deae7e9dc0 Write down what to try next in the search, with off-ramps
The queen table closing pointed somewhere else: this engine is limited by
cycles rather than bytes, and search.c is missing classical techniques that
cost almost nothing in either.  It already has iterative deepening, killers,
MVV-LVA and a well-ordered tree - about 2.28 moves a node before a cutoff -
which is what makes the missing ones worth having, since they pay off most when
ordering is already good.

The note names three in order of risk rather than size: PVS first because it
needs no gate at all, quiescence economies second because quiescence is most of
the tree at 400 nodes, and null-move last because it needs a gate and 5.1.6 is
the story of a gate that every desk instrument preferred and that lost the
match.

Each has its hazards written out where they are specific to this engine - the
2,700 spare in a 16-bit int above EVAL_INFINITY, the arena bail that is a
strength problem and not a crash, what a null move does to the repetition hash
- and each has a gate and an off-ramp.  "Measured, rejected, recorded" is
listed as a successful outcome, because it is one and this repo has published
several.

Also records what these changes should *not* cost.  Strength here is a node
budget, so a cheaper tree is deeper at the same budget and move times do not
move; the only real cost is the extra instructions per node, which has to be
priced on target rather than assumed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 16:13:13 -07:00