ridge runtime: view test pins the sign of the camera's sideways shift

A mutant that flipped the offset's sin(phi) term survived: the phi 90 test read
the shift by magnitude only. It now requires the shift to the left for a camera
clockwise of the heading and to the right for the other side.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-23 00:11:13 +01:00
commit 5fb77e2bcd

View file

@ -102,6 +102,9 @@ describe('cardPose', () => {
// The sideways part of a pose: where the line meets the heading's own column, a0 = shift / k + s (h - rest). // The sideways part of a pose: where the line meets the heading's own column, a0 = shift / k + s (h - rest).
const a0 = (q: { scale: number; shiftPx: number }) => q.shiftPx / k + q.scale * (135 - rest); const a0 = (q: { scale: number; shiftPx: number }) => q.shiftPx / k + q.scale * (135 - rest);
expect(a0(at(0))).toBeCloseTo(0, 6); expect(a0(at(0))).toBeCloseTo(0, 6);
// A camera to the clockwise side of the heading (east of a north view) sees the card to the left of it, and one on the other side to the right.
expect(a0(p)).toBeLessThan(0);
expect(a0(at(-90))).toBeGreaterThan(0);
// r / R x 57.3 degrees at the heading's own column; the line fitted over the arc takes the mean of cos over it, about 0.93 of that. // r / R x 57.3 degrees at the heading's own column; the line fitted over the arc takes the mean of cos over it, about 0.93 of that.
const centre = (200 / 12000) * (180 / Math.PI); const centre = (200 / 12000) * (180 / Math.PI);
expect(Math.abs(a0(p)) / centre).toBeGreaterThan(0.9); expect(Math.abs(a0(p)) / centre).toBeGreaterThan(0.9);