feat(sp21): T2.2 Phase 7.5 — E8 curriculum_weights → per-segment PER insert priority boost (atomic)
Closes the "true E8 per-segment PER sampling" deferral from Phase 7.
Phase 7 wired E8's SCALAR concentration to per_update_pa's alpha
boost; Phase 7.5 wires the FULL Vec<f32> of per-segment weights to
per_insert_pa's priority boost.
What lands:
1. 8 new ISV slots [528..536): CURRICULUM_WEIGHT_{0..8}_INDEX.
2. ISV_TOTAL_DIM 528 → 536 (bus extension); fingerprint adds 8 SLOT
entries; CURRICULUM_N_SEGMENTS=8 const + curriculum_weight_index
accessor.
3. per_insert_pa kernel reads isv[528 + seg_id] where seg_id = i % 8
(round-robin segment tag); effective priority × N_SEGMENTS ×
weight[seg_id]. Uniform weights → no-op (× 1.0); cold-start
sentinel → no-op; 0.1× floor against pathological zero-weight
segments preventing sticky exclusion.
4. Producer in training_loop writes 8 ISV slots from
result.curriculum_weights[0..8].
Segment tagging rationale:
- Naïve approach (tag tuples by val-curriculum-segment id) is
infeasible — val and training have separate coordinate systems
(same problem documented in Phase 5+6 audit re E6 winner indices).
- Round-robin via `i % 8` distributes experience-collector's typical
512+ tuple batch evenly across 8 segments. Over time buffer has
equal representation per segment; E8 weights redirect sampling
pressure toward "hard" segments at insert time.
- HEURISTIC mapping (doesn't preserve val-segment semantics) but
consumes the curriculum_weights vector for real PER priority
redistribution — Phase 7.5's stated goal.
Files changed:
- crates/ml/src/cuda_pipeline/sp21_isv_slots.rs: 8 new slot consts
+ N_SEGMENTS + curriculum_weight_index accessor + tests
- crates/ml/src/cuda_pipeline/gpu_dqn_trainer.rs: ISV_TOTAL_DIM bump
+ fingerprint
- crates/ml-dqn/src/per_kernels.cu: per_insert_pa per-segment boost
- crates/ml/src/trainers/dqn/trainer/training_loop.rs: producer wireup
- docs/dqn-wire-up-audit.md: 2026-05-11 audit entry
Verification (passing):
- cargo check -p ml --tests --features cuda: 0 errors
- cargo test -p ml --lib sp21_isv_slots: 4/4 (new curriculum_weight_
index test)
- sp20_aggregate_inputs_test: 12/12
- sp20_phase1_4_wireup_test: 2/2
- sp20_emas_compute_test: 4/4
- sp20_controllers_compute_test: 7/7
- sp21_per_trade_predicted_q_test: 3/3
Total: 35 tests, 0 failures.
SP21 T2.2 cascade — TRULY fully complete (13 atomic commits). Every
enrichment output E1-E8 wires to a real consumer. No remaining
deferrals or hardcoded controller anchors in SP21 T2.2 scope.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2622,7 +2622,7 @@ const ISV_NETWORK_DIM: usize = 23;
|
||||
/// (and the C-side mirrors in `state_layout.cuh`). Bump this constant in the
|
||||
/// SAME commit that adds the new range, and update `layout_fingerprint_seed`
|
||||
/// to register the new slot names.
|
||||
pub(crate) const ISV_TOTAL_DIM: usize = 528; // SP21 Phase 7 adds 1 slot [527..528) for CURRICULUM_CONCENTRATION (PER alpha scaling, composed with WINNER_CONCENTRATION + HINDSIGHT_MAGNITUDE); Phase 5+6 added 2 slots [525..527); Phase 4 added 4 slots [521..525) for BRANCH_LR_SCALE_*; Phase 3 added 1 slot [520..521) for Q_CORRECTION
|
||||
pub(crate) const ISV_TOTAL_DIM: usize = 536; // SP21 Phase 7.5 adds 8 slots [528..536) for CURRICULUM_WEIGHT_{0..8} (per_insert_pa per-segment priority boost); Phase 7 added 1 slot [527..528); Phase 5+6 added 2 slots [525..527); Phase 4 added 4 slots [521..525); Phase 3 added 1 slot [520..521)
|
||||
/// Legacy alias preserved for call sites that haven't been audited for the
|
||||
/// network-vs-total split. New code should pick `ISV_NETWORK_DIM` (for weight
|
||||
/// tensor sizing) or `ISV_TOTAL_DIM` (for the broadcast bus buffer).
|
||||
@@ -3756,7 +3756,15 @@ const fn layout_fingerprint_seed() -> &'static [u8] {
|
||||
SLOT_525_WINNER_CONCENTRATION=525;\
|
||||
SLOT_526_HINDSIGHT_MAGNITUDE=526;\
|
||||
SLOT_527_CURRICULUM_CONCENTRATION=527;\
|
||||
ISV_TOTAL_DIM=528;\
|
||||
SLOT_528_CURRICULUM_WEIGHT_0=528;\
|
||||
SLOT_529_CURRICULUM_WEIGHT_1=529;\
|
||||
SLOT_530_CURRICULUM_WEIGHT_2=530;\
|
||||
SLOT_531_CURRICULUM_WEIGHT_3=531;\
|
||||
SLOT_532_CURRICULUM_WEIGHT_4=532;\
|
||||
SLOT_533_CURRICULUM_WEIGHT_5=533;\
|
||||
SLOT_534_CURRICULUM_WEIGHT_6=534;\
|
||||
SLOT_535_CURRICULUM_WEIGHT_7=535;\
|
||||
ISV_TOTAL_DIM=536;\
|
||||
SP19_PRODUCER_HARDCODED_HORIZON_BLEND=sp19_path_b;\
|
||||
SP14_C_AUX_TRUNK_CONTROL_PLANE=sp14_c_phase_1;\
|
||||
ALPHA_MACHINERY_DELETED=sp14_c_phase_1;\
|
||||
|
||||
Reference in New Issue
Block a user