jgrusewski
ea12c172e6
test(sp21): T2.2 Phase 1.5 — kernel-direct GPU oracle for per-trade predicted_q
...
Promotes the Phase 2.5 follow-up from the plan to a load-bearing test.
Three #[ignore = "requires GPU"] tests exercise backtest_env_step_batch
directly with controlled inputs:
1. predicted_q_populated_on_close_with_real_q_values — open Long Full
at step 0 with q_values_per_window[w=0, a=Long_Full]=2.5, hold for
two bars, close Flat at step 3. Asserts the per-trade tape's
predicted_q[0] ≈ 2.5 (entry_q captured at open, persisted in
entry_q_state across holds, snapshotted before close emit).
2. predicted_q_stays_zero_when_q_values_is_null — same scenario with
q_values_per_window=NULL (single-step evaluate() semantics). The
kernel's open-time write is gated on the NULL guard, so
entry_q_state[w] stays at buffer-init 0.0 and the tape's
predicted_q is 0.0. Proves the NULL-tolerance contract is
kernel-enforced, not just launcher convention.
3. no_trades_no_predicted_q_emission — all-Flat action sequence
produces zero trades. Path-coverage check that entry_q's open
guard fires only on actual opens / reverses.
Test design:
- Kernel-direct (loads ENV_CUBIN via include_bytes!), no eval-pipeline
scaffolding (no QValueProvider, no cuBLAS forward, no chunked state
gather). Avoids the heavy mock infrastructure the plan flagged.
- Flat-market 4-bar single-window window: every OHLC=100, zero costs,
initial_capital=100k. Isolates the entry_q signal from P&L noise
so the assert-predicted_q is exact under IEEE-754 (kernel writes
the Q-value verbatim with no math).
- NULL fallback for isv_signals/conviction/exploration_scale matches
the existing single-step launcher pattern; FEATURE_DIM=4 (<41) ⇒
compute_regime_trail_scales takes the fixed-width fallback (no
feature deref needed).
Verification:
- SQLX_OFFLINE=true cargo test -p ml --test sp21_per_trade_predicted_q_test
--features cuda -- --ignored --nocapture
- 3/3 pass on RTX 3050 Ti (sm_86).
- All 4 prior SP20 GPU oracle suites still pass (25 tests).
- Total: 28 GPU oracle tests, 0 failures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-10 22:12:07 +02:00
..
2026-05-06 15:05:34 +02:00
2026-03-02 15:41:23 +01:00
2026-03-15 12:00:13 +01:00
2026-02-25 11:56:00 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-04-11 11:54:09 +02:00
2026-03-29 21:32:04 +02:00
2026-03-15 12:00:13 +01:00
2026-05-08 03:30:44 +02:00
2026-03-13 10:30:51 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-15 12:00:13 +01:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-04-11 11:54:09 +02:00
2026-02-25 11:56:00 +01:00
2026-04-11 11:54:09 +02:00
2026-03-19 10:02:26 +01:00
2026-04-28 18:54:00 +02:00
2026-04-27 17:52:23 +02:00
2026-03-13 10:18:35 +01:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-03-19 08:55:55 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-04-24 01:55:14 +02:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-04-01 01:13:19 +02:00
2026-03-25 09:45:54 +01:00
2026-04-28 18:54:00 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-03-31 01:30:33 +02:00
2026-03-31 01:30:33 +02:00
2026-04-24 01:55:14 +02:00
2026-04-28 18:54:00 +02:00
2026-04-11 11:54:09 +02:00
2026-03-19 10:02:26 +01:00
2026-04-28 18:54:00 +02:00
2026-04-11 11:54:09 +02:00
2026-03-16 21:01:28 +01:00
2026-03-16 21:01:28 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-04-11 15:21:21 +02:00
2026-03-31 10:56:20 +02:00
2026-04-28 18:54:00 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-25 09:45:54 +01:00
2026-03-29 21:32:04 +02:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-31 01:30:33 +02:00
2026-04-20 15:29:05 +02:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-04-23 11:36:34 +02:00
2026-05-06 23:39:45 +02:00
2026-05-10 08:56:19 +02:00
2026-03-25 09:45:54 +01:00
2026-03-19 10:02:26 +01:00
2026-03-31 10:56:20 +02:00
2026-03-13 10:18:35 +01:00
2026-03-31 01:30:33 +02:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 08:59:52 +01:00
2026-03-20 15:41:42 +01:00
2026-03-19 10:02:26 +01:00
2026-03-18 00:53:47 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-04-01 01:13:19 +02:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-04-28 09:10:31 +02:00
2026-03-15 12:00:13 +01:00
2026-05-09 14:45:20 +02:00
2026-04-28 09:23:32 +02:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-04-20 15:29:05 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-19 10:02:26 +01:00
2026-03-19 08:59:52 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-04-11 15:21:21 +02:00
2026-03-19 10:02:26 +01:00
2026-03-19 10:02:26 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-04-23 08:44:05 +02:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-04-23 08:44:05 +02:00
2026-04-02 14:21:45 +02:00
2026-03-13 10:18:35 +01:00
2026-04-11 11:54:09 +02:00
2026-03-19 08:59:52 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-03-19 10:02:26 +01:00
2026-03-19 10:02:26 +01:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-04-28 18:54:00 +02:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 08:55:55 +01:00
2026-03-13 10:18:35 +01:00
2026-05-09 13:38:48 +02:00
2026-03-15 12:00:13 +01:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00
2026-05-03 09:52:33 +02:00
2026-03-19 10:02:26 +01:00
2026-05-05 10:52:13 +02:00
2026-05-03 11:34:21 +02:00
2026-05-04 11:51:30 +02:00
2026-05-04 19:32:18 +02:00
2026-05-05 14:45:47 +02:00
2026-05-05 14:09:48 +02:00
2026-05-09 10:43:11 +02:00
2026-05-10 08:56:19 +02:00
2026-05-08 23:02:35 +02:00
2026-05-09 01:36:52 +02:00
2026-05-09 11:05:03 +02:00
2026-05-09 02:09:25 +02:00
2026-05-09 11:25:50 +02:00
2026-05-09 01:47:48 +02:00
2026-05-09 18:25:08 +02:00
2026-05-10 20:35:39 +02:00
2026-05-09 19:09:06 +02:00
2026-05-10 20:13:13 +02:00
2026-05-09 23:59:49 +02:00
2026-05-10 08:56:19 +02:00
2026-05-10 02:22:15 +02:00
2026-05-09 20:37:05 +02:00
2026-05-10 20:35:39 +02:00
2026-05-09 19:46:17 +02:00
2026-05-10 22:12:07 +02:00
2026-03-19 10:02:26 +01:00
2026-03-21 09:14:53 +01:00
2026-04-10 18:52:21 +02:00
2026-03-19 08:59:52 +01:00
2026-03-19 10:02:26 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 08:44:50 +01:00
2026-03-19 10:02:26 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 08:44:50 +01:00
2026-03-15 12:00:13 +01:00
2026-03-19 10:02:26 +01:00
2026-03-19 10:02:26 +01:00
2026-03-19 08:44:50 +01:00
2026-03-19 08:59:52 +01:00
2026-03-16 16:11:48 +01:00
2026-03-14 11:35:15 +01:00
2026-04-11 15:21:21 +02:00
2026-04-11 11:54:09 +02:00
2026-03-13 10:18:35 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-04-04 10:02:37 +02:00
2026-04-11 11:54:09 +02:00
2026-04-11 11:54:09 +02:00
2026-03-15 12:00:13 +01:00
2026-03-15 12:00:13 +01:00
2026-03-13 10:18:35 +01:00
2026-03-19 10:02:26 +01:00