T10 train-multi-seed-khr7c (commit 8a25b330f, post-Fix-37) showed val-Flat-
collapse persisting at the eval-side selector despite all SP9 controller
fixes — dir_entropy=0 / trade_count=1 in 214,654 bars because
experience_action_select branched on eval_mode and used argmax(E[Q]) at
eval. With Hold's E[Q] ≈ 0 and directional E[Q] = ε (small edge minus tx
costs), argmax wins Hold deterministically every bar.
Per pearl_thompson_for_distributional_action_selection (amended): the
rollout SELECTOR is unconditional Thompson at all times (training AND
eval); argmax is reserved for the Bellman TARGET Q computation only
(DDQN target). Per pearl_controller_anchors_isv_driven: the temperature
on the Thompson sample is ISV-driven from the SP9 intent_eval_divergence
canary. Per pearl_blend_formulas_must_have_permanent_floor: MIN_TEMP=0.5
is the permanent-stochasticity floor — the eval selector is NEVER fully
deterministic.
Atomic commit per feedback_no_partial_refactor:
* 1 new ISV slot @ [339..340) (EVAL_THOMPSON_TEMP_INDEX); ISV_TOTAL_DIM
339 → 340; SP5_PRODUCER_COUNT 165 → 166; layout fingerprint updated
* 1 new scratch slot @ [265..266) (SCRATCH_SP10_THOMPSON_TEMP);
SP5_SCRATCH_TOTAL 265 → 266
* intent_eval_divergence_compute_kernel.cu extended with 2 params
(divergence_target_isv_index, scratch_temp_idx) + new compute branch
temp = clamp(divergence/div_target, 0.5, 2.0); existing scratch_idx
renamed scratch_div_idx for semantic clarity
* experience_action_select: if (eval_mode) { argmax(E[Q]) } DELETED;
unconditional temperature-blended Thompson installed:
q_eff[d] = E[Q][d] + temp · (q_sample[d] − E[Q][d]); defensive clamp
to [0.5, 2.0] for cold-start before producer first observation. Other
branches (mag/ord/urg) keep their existing eps-greedy/Boltzmann logic
per pearl_thompson §3 exemption
* state_layout.cuh: new ISV_EVAL_THOMPSON_TEMP_IDX 339 define
* gpu_dqn_trainer.rs::launch_intent_eval_divergence_compute extended
with 2 kernel args + second apply_pearls_ad_kernel chain to smooth
the temperature into ISV[339]
* New FoldReset entry sp10_eval_thompson_temp + dispatch arm in
reset_named_state writing sentinel 0; Pearl A's first-observation
replacement fires on the new fold's first producer launch
* Test renamed test_eval_action_select_eval_argmax_picks_best →
test_eval_action_select_thompson_picks_proportionally; ISV buffer
setup with EVAL_THOMPSON_TEMP_INDEX=1.0 (pure Thompson); assertions
updated to ≥ 70% best-direction wins (was ≥ 99% under deterministic
argmax) and < 100% (selector is sampling)
* Pearl pearl_thompson_for_distributional_action_selection §4 amended;
MEMORY.md index entry updated
* Audit doc Fix 38 entry
Verification:
* SQLX_OFFLINE=true cargo check -p ml — clean (only pre-existing 18
warnings; no new errors or warnings introduced by Fix 38)
* SQLX_OFFLINE=true cargo test -p ml --lib state_reset — 4/4 pass
including contract test every_fold_and_soft_reset_entry_has_dispatch_arm
* SQLX_OFFLINE=true cargo test -p ml --lib sp5_isv_slots — 10/10 pass
including new sp10_thompson_temp_slot_above_sp9_block
* SQLX_OFFLINE=true cargo test -p ml --lib test_eval_action_select_thompson —
pass (RTX 3050 Ti local; τ=1.0 with clear Q gap → P(Long) ≥ 0.70 < 1.0)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>