From 4567c2e18bf20ecec79e0579a07c580776066871 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Wed, 2 Sep 2026 19:38:10 -0500 Subject: [PATCH] exp: absolute position and own-side rank as attributes The CPPN sees only r_ij, so the representation is translation-invariant and a chess board has edges: a knight has 2.96 destinations on the rim against 6.85 in the middle, and 43% of them sit on the rim. Relative geometry to other pieces cannot recover that on a near-empty board, and the shape control is handed the square while the organism was not. own_rank is rank from the piece's own back rank, so a pawn's push, its double-push rank, its promotion and castling are one law rather than two mirrored ones. --- AGENTS.md | 15 +++++++++++++++ chess_rules.py | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 990da30..07148ba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -47,6 +47,21 @@ directory. domain's own structure; a null on a model that has not is uninterpretable. This is the sibling of the oracle rule: the oracle asks whether the information pays, this asks whether the architecture can hold it. +- **Teach the basics before measuring anything on top of them.** Training from scratch means + the domain's laws have to be *reachable* from what the organism is given, and on chess five + separate things were not, each found by measurement rather than argument: + the piece type never entered the kernel (knight's L at exactly 0.000, `chess_reach.md`); + the target was `attacks`, which for a pawn on e2 returns d3/f3 while its moves are e3/e4 — + no overlap — and omits castling and en passant entirely; + games never show an open board (a rook is blocked in 98-100% of real positions), so the rule + cannot be induced from play; + absolute position was erased by a translation-invariant input, while the answer depends on it + (a knight has 2.96 destinations on the rim and 6.85 in the middle, and 43% sit on the rim); + and rank was not oriented to the piece's own side, which splits one pawn law into two + mirrored ones. + Every memory null measured before these were fixed stands as a fact about that setup and + about nothing else. Before asking what a mechanism adds, check that the domain's own laws + are expressible in the inputs, the target, and the training distribution. - **Pre-register when the result could be argued either way.** State the success criterion, the seed count, and what counts as failure, in `.sdd/progress.md`, before the run. Then accept what comes back. No re-running with adjusted criteria. diff --git a/chess_rules.py b/chess_rules.py index b4f3db2..ea8eb25 100644 --- a/chess_rules.py +++ b/chess_rules.py @@ -38,7 +38,14 @@ from ailed import Affect, Organism from chess_domain import flat_diff from chess_reach import GRID, OFFSET -ATTR_DIM = 9 # type (6), colour (1), this piece still has a castling right (1), ep flag (1) +# type (6), colour (1), castling right (1), ep flag (1), file, rank, rank-from-my-own-side (3) +ATTR_DIM = 12 +# The last three exist because the CPPN sees only r_ij, which makes the representation +# translation-invariant -- and a chess board has EDGES. A knight on the rim has 2.96 +# destinations on average and one in the middle has 6.85, and 43% of knights sit on the rim +# (measured). Relative geometry to other pieces cannot recover that on a near-empty board. +# `own_rank` is rank from the piece's own back rank: a pawn's push, its double-push rank, its +# promotion rank and castling are all one law in that frame and two mirrored laws without it. HOME = ((chess.WHITE, chess.E1, chess.H1, chess.A1), (chess.BLACK, chess.E8, chess.H8, chess.A8)) @@ -148,7 +155,11 @@ def build(b: chess.Board) -> Position: ep = b.ep_square if (b.ep_square is not None and p.piece_type == chess.PAWN and b.ep_square in _rule_only(p, sq, False, None)) else None attrs[k, 8] = float(ep is not None) - coords[k] = (chess.square_file(sq) / 7.0, chess.square_rank(sq) / 7.0) + f, r = chess.square_file(sq), chess.square_rank(sq) + coords[k] = (f / 7.0, r / 7.0) + attrs[k, 9] = f / 7.0 + attrs[k, 10] = r / 7.0 + attrs[k, 11] = (r if p.color == chess.WHITE else 7 - r) / 7.0 for t in dests.get(sq, ()): y[k, OFFSET[sq][t]] = 1.0 for t in _rule_only(p, sq, right, ep):