feat(sp22-vNext): Phase A2 — trade-outcome label producer kernel

First foundation kernel for the H6 vNext trade-outcome aux head.

Per-env classification at trade-close events into K=3 outcomes:
- 0 = Profit (pnl_vs_target >= 1.0)
- 1 = Stop (pnl_vs_stop >= 1.0)
- 2 = Timeout (neither threshold hit)

Sparse labels — most bars get -1 mask. Priority: Profit > Stop > Timeout.

Pure per-env map; no atomicAdd, no reduction. Launch: grid(ceil(N/256)),
block(256).

Registered in build.rs. Cubin compiles clean. Currently dead code —
launcher wireup comes in Phase A3+ commits.

See docs/plans/2026-05-14-sp22-h6-vNext-trade-outcome-aux.md for the
full vNext architecture.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-05-13 21:55:34 +02:00
parent d0c037a3d2
commit 26ce7ba690
3 changed files with 167 additions and 0 deletions

View File

@@ -792,6 +792,16 @@ fn main() {
// producer chain has fresh labels every rollout step. Same per-thread
// O(1) map; same lookahead window semantics; same skip sentinel.
"aux_sign_label_per_step_kernel.cu",
// SP22 H6 vNext (2026-05-13): trade-outcome label producer kernel.
// Replaces the per-bar binary direction label with a per-trade-close
// 3-way outcome label {Profit, Stop, Timeout}. Sparse labels
// (only at trade-close events) but aligned with the system's
// actual multi-bar trade decision horizon. See
// `docs/plans/2026-05-14-sp22-h6-vNext-trade-outcome-aux.md` for
// the full vNext architecture spec. This kernel is the FOUNDATION
// (Phase A2) — additional kernels for aux forward / loss /
// backward + 12-weight W atom-shift land in subsequent commits.
"trade_outcome_label_kernel.cu",
// SP22 H6 (2026-05-12): per-env p_up extractor that copies
// `aux_softmax[env, 1]` → `prev_aux_dir_prob[env]` after each aux
// forward. The cache buffer is read by `experience_state_gather`