Stochastic depth (#21): replaced rand::thread_rng() + memcpy_htod
with GPU-native stochastic_depth_rng kernel. Single-thread LCG
generates 3 per-layer drop/keep scales directly in GPU memory.
Zero CPU RNG, zero HtoD transfers per training step.
Causal intervention (#34): replaced per-feature CPU zeroing loop
(B × cuMemcpyHtoDAsync per feature) and DtoH Q-value comparison with:
- causal_intervene_feature kernel: GPU-native state copy + feature zero
One thread per batch sample, handles entire row copy + selective zero
- causal_q_delta_reduce kernel: GPU reduction of |Q_orig - Q_interv|²
Block-level reduction with atomicAdd into sensitivity buffer
Only 1 DtoH of 168 bytes at the end (sensitivity readback for logging).
Audit result — remaining CPU paths in our code:
- Feature mask RNG: 42 floats, once per epoch (config generation)
- Domain randomization RNG: ~10 scalars, once per epoch (config generation)
- Causal sensitivity readback: 168 bytes, every 10th step (logging only)
All per-step computation is now 100% GPU-native.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>