Skip to content

python-math #27: feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in both replay drivers - #2655

Draft
jucor wants to merge 1 commit into
spr/edge/7ae9c688from
spr/edge/6b40e1bf
Draft

python-math #27: feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in both replay drivers#2655
jucor wants to merge 1 commit into
spr/edge/7ae9c688from
spr/edge/6b40e1bf

Conversation

@jucor

@jucor jucor commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Why

Quirk Q12: production Clojure draws an UNSEEDED random start vector for PCA power iteration on the cold tick — a conversation's first math update, where there is no previous result to warm-start from (rand-starting-vec, pca.clj:79-82, complete with the original author's own comment: "should really throw a [seeded] random number generator in the equation here... XXX"). With a small eigengap, the fixed 100 power iterations do not fully converge, so a start-dependent residual survives into the output (~4e-4 on the pc-smallmix-01 battery entry at step 0). Even two Clojure runs differ on cold ticks — no deterministic reference exists to certify against.

What

Both replay drivers (the Clojure and Python harness programs that feed a recorded vote schedule through their respective engines) now pin the cold start to the ONES vector — the exact value power iteration already pads new-comment columns with (pca.clj:46-49 / pca.py _power_iteration). The pin works by seeding the conversation with a single-element [1.0] start vector that the existing padding expands to any width (dev/replay.clj certify-cold-start-pca; polismath/replay/driver.py). Warm ticks are untouched: from tick 2 on they take the real previous components exactly as before. The pin is logged per run, and the quirk is ledgered as Q12 in CLOJURE_QUIRKS.md.

Battery effect

In the certification battery (recorded real-conversation vote schedules replayed through both engines and compared step by step):

  • pc-smallmix-01 and pc-midmix-01 went DIVERGENCE -> MATCH.
  • pc-revote-01's step 0 cleared (its remaining residual from step 1 on comes from split-loop extraction order on tie-dense 15-comment geometry, diagnosed separately).
  • 14/15 MATCH with the five prodclone extractions (datasets extracted from the production-database clone) in the battery.

commit-id:6b40e1bf


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 22, 2026
@jucor
jucor force-pushed the spr/edge/6b40e1bf branch from 98091d8 to 63cdd5b Compare July 22, 2026 10:06
@jucor jucor changed the title feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in both replay drivers feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in … Jul 22, 2026
This was referenced Jul 25, 2026
@jucor
jucor force-pushed the spr/edge/6b40e1bf branch from 63cdd5b to 659e9ef Compare July 28, 2026 00:11
@jucor
jucor force-pushed the spr/edge/7ae9c688 branch from 2ac4c32 to 3861330 Compare July 28, 2026 00:12
@jucor jucor changed the title feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in both replay drivers python-math #27: feat(delphi): Q12 carve-out — pin the cold-tick PCA start to ones in both replay drivers Jul 28, 2026
…start to ones in both replay drivers

## Why

Quirk Q12: production Clojure draws an UNSEEDED random start vector for PCA power iteration on the cold tick — a conversation's first math update, where there is no previous result to warm-start from (`rand-starting-vec`, `pca.clj:79-82`, complete with the original author's own comment: "should really throw a [seeded] random number generator in the equation here... XXX"). With a small eigengap, the fixed 100 power iterations do not fully converge, so a start-dependent residual survives into the output (~4e-4 on the `pc-smallmix-01` battery entry at step 0). Even two Clojure runs differ on cold ticks — no deterministic reference exists to certify against.

## What

Both replay drivers (the Clojure and Python harness programs that feed a recorded vote schedule through their respective engines) now pin the cold start to the ONES vector — the exact value power iteration already pads new-comment columns with (`pca.clj:46-49` / `pca.py` `_power_iteration`). The pin works by seeding the conversation with a single-element `[1.0]` start vector that the existing padding expands to any width (`dev/replay.clj` `certify-cold-start-pca`; `polismath/replay/driver.py`). Warm ticks are untouched: from tick 2 on they take the real previous components exactly as before. The pin is logged per run, and the quirk is ledgered as Q12 in `CLOJURE_QUIRKS.md`.

## Battery effect

In the certification battery (recorded real-conversation vote schedules replayed through both engines and compared step by step):

- `pc-smallmix-01` and `pc-midmix-01` went DIVERGENCE -> MATCH.
- `pc-revote-01`'s step 0 cleared (its remaining residual from step 1 on comes from split-loop extraction order on tie-dense 15-comment geometry, diagnosed separately).
- 14/15 MATCH with the five prodclone extractions (datasets extracted from the production-database clone) in the battery.

commit-id:6b40e1bf
@jucor
jucor force-pushed the spr/edge/6b40e1bf branch from 659e9ef to cd66035 Compare July 28, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants