Files
xscapes/pace_side_test.go
donlucasandClaude Opus 5 d02530bb54 The cat becomes a companion, and three fixes measured worse than their bugs
Two days of his design round: I drew, he ruled from rendered options.

THE CAT. It asks with its ears ("Pricked ears"), finishes with its chin up,
and walks up its own ladder -- 12x7 -> 16x9 -> 24x14, the middle rung the
Faithful Scale-Up with its nose removed, the top rung "Ruffed sit", drawn.
Before this the ask and the finish were the WORKING body: measured over 1,200
frames a pose, bodies only, 97% of a still of either was also a still of the
cat simply working. Now 0%, asserted, with Worried as the positive control.

The crab finishes "settled on the sand" with one pincer shutting every 7 s.
crabDone was DEAD ART -- it raised a claw by a single source row and the row
OR ate it, so all six half-rows were crabWork's. The finish cue has been the
eye glyph alone since it was written.

Its near eye rotates through four faces, picked on the RISING EDGE of an ask
and held. Random carries no information, which is the only reason a second
mark on that channel is legal at all.

THE OR-TRAP, which he caught from both sides. CatBody row 11 is a muzzle gap
row 10 covers, so the cat has never had a mouth on screen. A 16x9 draft grew a
nose; doubling for the top rung grew a mouth. Two general fixes were measured
and rejected -- half-row doubling flattens nine tapered rows, and filling every
covered interior gap also eats the notch between the ears.

FIXED: the cat's mid-stride drew a 16-cell side view inside the 12-cell box and
put the eyes 6 and 10 cells off the head, 4,037 times across 31 sessions ·
hyFloor ignored the horizon and allowed water above it in 81 configurations ·
the unmirrored layout paced the companion toward the frame edge · emit accepted
any word as a kind and confirmed delivery of nothing · XSCAPES_COMPANION was
double-prefixed and had never worked · the cat's parent body had no cleared rim ·
the tail could not scale, so a doubled cat arrived bald · DrawnHeadCol ignored
the mirror, which the crab's symmetric eye cells had hidden.

NOT FIXED, and both put back after measuring worse than the bug: a fractional
tide depth churns 53.62% every frame against ~64% on crossings alone; making
the star separation strict took touching pairs from 10 to 12. Carded with the
numbers. An average that passes is not a ceiling that holds.

Studies, none of them shipping behaviour: -starfall (the star arriving, 1,805
swept arrivals), -catalts (the design round), -decisions (what is still open).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P7YSpTVSL4ws8rgG1X4mtt
2026-09-12 21:19:55 -07:00

73 lines
2.6 KiB
Go

package main
import (
"testing"
"github.com/donlucasx/xscapes/internal/companion"
"github.com/donlucasx/xscapes/internal/reduce"
)
// THE PACE MOVES THE COMPANION INWARD, on whichever side it stands.
//
// paceAt returns a NEGATIVE offset -- inward, toward the centre -- and that is
// inward only for a companion anchored on the RIGHT. The unmirrored layout
// anchors it at column 5 on the LEFT, so the same offset walked it toward the
// frame edge instead of away from it.
//
// ⚠ WHAT I COULD NOT REPRODUCE, stated so nobody trusts it again: the note this
// was carded from said the companion reached COLUMN -1 at 124 columns. It does
// not. Measured across 80, 124 and 153 columns and every step count, the worst
// unmirrored position before the fix was catX = 1 -- pressed against the edge,
// never off it. The defect is the DIRECTION, not a crash off the frame, and a
// test written to the carded symptom would have been a test that cannot fail.
//
// ⚠ AND IT GOES THROUGH compose() AND pace(). An earlier version applied the
// sign flip itself and asserted its own arithmetic, which passed with the fix
// deleted from live.go.
func TestThePaceMovesInwardOnBothSides(t *testing.T) {
cw, _ := companion.New(companion.DefaultName).Size()
for _, w := range []int{40, 60, 80, 107, 124, 143, 153} {
for _, mirror := range []bool{true, false} {
lay := compose(w, cw, mirror)
centre := float64(w) / 2
home := float64(lay.CatX) + float64(cw)/2
moved := 0
for steps := 1; steps <= 24; steps++ {
st := reduce.State{Steps: steps, StepAge: 0.1, Pose: companion.Working}
dx := paceOffset(st, lay, w)
if dx == 0 {
continue
}
moved++
at := home + dx
// Inward means closer to the middle of the frame than home.
if abs(at-centre) > abs(home-centre)+0.001 {
t.Errorf("w=%d mirror=%v steps=%d: the companion moved OUTWARD -- home is "+
"%.1f from the centre, it walked to %.1f",
w, mirror, steps, abs(home-centre), abs(at-centre))
}
if at-float64(cw)/2 < 0 {
t.Errorf("w=%d mirror=%v steps=%d: drawn at column %.0f", w, mirror, steps,
at-float64(cw)/2)
}
}
if moved == 0 {
t.Errorf("w=%d mirror=%v: the companion never moved, so nothing was tested",
w, mirror)
}
// The sand has to leave room for wherever it can walk to.
if !mirror && lay.CatX+cw+lay.PaceSpan > lay.SandFrom {
t.Errorf("w=%d: the companion can reach column %d but the sand starts at %d",
w, lay.CatX+cw+lay.PaceSpan-1, lay.SandFrom)
}
}
}
}
func abs(f float64) float64 {
if f < 0 {
return -f
}
return f
}