Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

feat(recon): depth-phased routing wave (stacked on #977)#979

Open
claude-spd1 wants to merge 3 commits into
feature/routing-schedules-fixed-kfrom
feature/depth-phased-routing
Open

feat(recon): depth-phased routing wave (stacked on #977)#979
claude-spd1 wants to merge 3 commits into
feature/routing-schedules-fixed-kfrom
feature/depth-phased-routing

Conversation

@claude-spd1

Copy link
Copy Markdown
Collaborator

Description

depth_phased_probability routing for the subset recon terms: per-site Bernoulli(p_layer(step)) where each layer runs the p template (a ScheduleConfig) compressed onto [t_layer, total_steps], with layer start times staggered linearly over wave_span_frac of training. direction="backward" (default) starts the DEEPEST layer at step 0 — a routing wave sweeping back through the network; "forward" is the mirrored control. Layer indices parse from the h.<i>. site-name prefix (asserted, so non-layer targets refuse loudly). wave_span_frac=0 degenerates to scheduled_probability. SPEC S11 amended additively.

Stacked on #977 (needs its RoutingSampler step-arg plumbing); base is feature/routing-schedules-fixed-k — retarget to feature/jax after #977 merges.

Motivation and Context

Oli's ask on the board task run-some-random-architecture-ideas: later layers have shorter causal paths to the output so should be easier to learn initially — ramp their routing probability up earlier, a wave moving backwards. Runs alongside the champion-vs-baseline seed sweep.

How Has This Been Tested?

3 new tests in test_routing.py: backward wave orders layer means correctly mid-training and converges to the endpoint at end; forward mirrors backward layer-wise; non-h.<i>. site names refused. All 11 routing tests green; basedpyright clean; integration smoke through real jitted train steps (both directions, finite losses).

Does this PR introduce a breaking change?

No — purely additive config variant; existing samplers untouched.

Crew-Address: task/run-some-random-architecture-ideas

🤖 Generated with Claude Code

PD User (shared) and others added 3 commits July 13, 2026 05:23
depth_phased_probability routing: per-site Bernoulli(p_layer(step)) where
each layer runs the p template compressed onto [t_layer, total_steps],
start times staggered linearly over wave_span_frac of training. Backward
(default) starts the DEEPEST layer at step 0 — Oli's intuition that later
layers, with shorter causal paths to the logits, are easier to learn
first — sweeping the wave backwards through the network; forward is the
mirrored control. Layer indices parse from the h.<i>. site-name prefix
(asserts, so toy targets refuse loudly). wave_span_frac=0 degenerates to
scheduled_probability. R1 independence unchanged.

Crew-Address: task/run-some-random-architecture-ideas
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…2'/S24)

PersistentPGDReconLossConfig gains a routing field (default all — byte-
identical for every existing config); build_loss_terms uses it in place
of the hardcoded AllRoutingConfig literal. The step already honored
routes for persistent entries, so this only unpins the plan. Warmup
ascents stay route-all (S24 torch parity). An unrouted position's
persistent source gets zero gradient that step (frozen path, S14 grad
reuse) and resumes when re-routed. S12' already admits subset-routed
adversarial terms.

Requested by Oli (slack, 2026-07-13) to include PPGD routing in the
subset-routing investigation.

Crew-Address: task/run-some-random-architecture-ideas
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…aw (S24 amended)

Per Oli's decision (slack 2026-07-13): commit entirely to the routing
being used — a persistent term draws its routing ONCE per step and the
SAME draw covers all warmup ascents and the final loss forward, so the
adversary trains and is scored under identical routing (matching
fresh-PGD's single-draw semantics). Supersedes the S24 warmup
route-all torch-parity pin. Byte-identical for route-all configs: the
final-forward routing key derivation is unchanged, and route-all warmup
routes are None exactly as before (stacked-parity suite green).

Crew-Address: task/run-some-random-architecture-ideas
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant