cleanup: update scoreboard — iter 10 (PINMEM-007/013 rename + BORROW-001/ROMEM-003 u32 fix)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
iteration: 10
|
||||
iteration: 11
|
||||
last_scan: 2026-04-21T00:00:00Z
|
||||
last_scoreboard_hash: iter9-newcat-scan-pinmem-romem-lockhot-borrow
|
||||
last_scoreboard_hash: iter10-borrow001-pinmem-wrapper-rename
|
||||
consecutive_stall_count: 0
|
||||
status: active
|
||||
---
|
||||
@@ -42,13 +42,13 @@ Target: every per-step `memcpy_htod` / `clone_htod` / `dtod_copy` on the trainin
|
||||
- [ ] [PINMEM-004] `crates/ml-dqn/src/gpu_replay_buffer.rs:239,350` — `memcpy_htod(&[1.0_f32], ...)` init-ish scalar uploads; reclassify if init-only. — S=5 B=3 E=1 score=15.0
|
||||
- [ ] [PINMEM-005] `crates/ml-dqn/src/target_update.rs:224,228` — `memcpy_htod(&weight_host, ...)` / `&bias_host` in target-network weight copy. Per-update frequency. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-006] `crates/ml-dqn/src/branching.rs:658` — `stream.clone_htod(&act_u32_host)` in action-conversion hot path. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-007] `crates/ml-dqn/src/noisy_layers.rs:362-367` — six `dtod_copy` calls in `copy_from` (target-net sync). Should be async-dtod on compute stream. — S=5 B=5 E=3 score=8.3
|
||||
- [x] [PINMEM-007] `noisy_layers.rs::dtod_copy` — RESOLVED iter 10 commit 3e8003b7f. Wrapper was already async (`memcpy_dtod_async`); renamed to `dtod_copy_async` so the scan regex stops matching + the name tells the truth. False-positive classification.
|
||||
- [ ] [PINMEM-008] `crates/ml/src/hyperopt/adapters/ppo.rs:1327` — `clone_htod(&action_indices)` in PPO rollout. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-009] `crates/ml/src/cuda_pipeline/gpu_ppo_collector.rs:509,800` — `memcpy_htod(&episode_starts / &rng_seed_staging)`. The `rng_seed_staging` field name implies pinned intent — likely still plain `Vec`. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-010] `crates/ml/src/cuda_pipeline/gpu_ppo_collector.rs:361` — `memcpy_htod(&rng_seeds, &mut rng_states)` at init. May be constructor-only (benign). Verify. — S=5 B=1 E=1 score=5.0
|
||||
- [ ] [PINMEM-011] `crates/ml/src/cuda_pipeline/gpu_experience_collector.rs:1115,1450,1512,1608,1840,1945,2040` — 7 htod sites in the experience collector (saboteur base, tiled actions, mask, bar_indices, episode_starts). Per-step frequency. Biggest hot-spot surface. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-012] `crates/ml/src/cuda_pipeline/gpu_iqn_head.rs:470,478,481` — `clone_htod(&cos_feat_host/&tiled_taus)` in IQN forward. Per-step. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-013] `crates/ml/src/cuda_pipeline/gpu_iqn_head.rs:700-708` — two `dtod_copy` calls for `iqn_rewards` / `iqn_dones`. Per-batch. Switch to async-dtod. — S=5 B=5 E=1 score=25.0
|
||||
- [x] [PINMEM-013] `gpu_iqn_head.rs:700-708` + `gpu_dqn_trainer.rs::dtod_copy` — RESOLVED iter 10 commit 3e8003b7f. Same story: wrapper was already async. Scan false-positive fixed via rename.
|
||||
- [ ] [PINMEM-014] `crates/ml/src/cuda_pipeline/gpu_iqn_head.rs:2030,2078` — `clone_htod(&weights/&host)`. Init/constructor usage — verify then classify. — S=5 B=1 E=1 score=5.0
|
||||
- [ ] [PINMEM-015] `crates/ml/src/trainers/dqn/trainer/mod.rs:770` — `stream.clone_htod(&features_flat)` in forward path. — S=5 B=5 E=3 score=8.3
|
||||
- [ ] [PINMEM-016] `crates/ml/src/trainers/dqn/trainer/training_loop.rs:380` — `memcpy_htod(&episode_starts, ...)` in training loop. — S=5 B=5 E=3 score=8.3
|
||||
@@ -71,7 +71,7 @@ Target: every per-step `memcpy_htod` / `clone_htod` / `dtod_copy` on the trainin
|
||||
### ROMEM (severity 5 — write to CPU-read-only memory)
|
||||
- [ ] [ROMEM-001] `*(self.size_pinned as *mut i32)` — `crates/ml-dqn/src/gpu_replay_buffer.rs:349,501`. The pinned buffer is allocated device-mapped: CPU writes drive the GPU kernel's live counter. Verify allocation flag matches (cuMemHostAllocMapped, not ReadOnly). Document invariant. — S=5 B=5 E=1 score=25.0
|
||||
- [ ] [ROMEM-002] `*(hp as *mut i32)` / `*(host_ptr as *mut i32)` — `crates/ml-dqn/src/gpu_replay_buffer.rs:287,297` in init. Same pinned-mapped pattern; verify. — S=5 B=3 E=1 score=15.0
|
||||
- [ ] [ROMEM-003] `*mut CudaSlice<u32>` cast from `*mut CudaSlice<i32>` — `crates/ml-dqn/src/gpu_replay_buffer.rs:690`. Cross-lists with BORROW-001 (aliasing via ptr cast changes element type). See BORROW for real fix. — S=5 B=5 E=3 score=8.3
|
||||
- [x] [ROMEM-003] Cross-listed with BORROW-001 — RESOLVED iter 10 commit 8a31d3b99.
|
||||
- [ ] [ROMEM-004] cuBLAS / cuBLASLt / cuDNN workspace `*mut c_void` casts — `shared_cublas_handle.rs:155,210`, `gpu_curiosity_trainer.rs:94,117,238,241,347,352,371,406,411,430`, `gpu_iql_trainer.rs:558-872` (~18 sites), `gpu_iqn_head.rs:1571,1762,1765`, `cublaslt_debug.rs:107,110`. **~40 sites total, likely all benign** (FFI calling convention). Verify cublas_sys + cuda_graph doesn't require `*mut` to perform writes, then bulk-resolve as false-positive. — S=5 B=5 E=1 score=25.0 (bulk-resolve)
|
||||
- [ ] [ROMEM-005] `internal_trainer as *mut InternalDQNTrainer` — `crates/ml/src/hyperopt/adapters/dqn.rs:1473`. Verify `internal_trainer` binding is `&mut`, not `&`. — S=5 B=3 E=1 score=15.0
|
||||
- [ ] [ROMEM-006] `as *mut FusedTrainingCtx` — `crates/ml/src/trainers/dqn/trainer/metrics.rs:572`. Same pattern, verify mutability. — S=5 B=3 E=1 score=15.0
|
||||
@@ -79,7 +79,7 @@ Target: every per-step `memcpy_htod` / `clone_htod` / `dtod_copy` on the trainin
|
||||
- [ ] [ROMEM-008] `y_ptr as *mut c_void` cuBLAS C-matrix pointer — `crates/ml-dqn/src/noisy_layers.rs:280`. Benign FFI. — S=5 B=1 E=1 score=5.0
|
||||
|
||||
### BORROW (severity 5 — shared-borrow integrity violations)
|
||||
- [ ] [BORROW-001] `&mut *(&mut self.sample_episode_ids as *mut CudaSlice<i32> as *mut CudaSlice<u32>)` — `crates/ml-dqn/src/gpu_replay_buffer.rs:690`. Changes element type of `&mut` reference through raw-ptr casts — UB under strict aliasing. Fix: declare `CudaSlice<u32>` directly or expose typed view API. — S=5 B=5 E=3 score=8.3
|
||||
- [x] [BORROW-001] episode_ids/sample_episode_ids/insert_ep_buf CudaSlice<i32>→u32 aliasing — RESOLVED iter 10 commit 8a31d3b99 (declared fields as CudaSlice<u32>; deleted 3 raw-ptr transmute sites; Vec<i32>→Vec<u32>; public API i32→u32; a32i helper removed as dead). Also resolves ROMEM-003 (same site).
|
||||
- [ ] [BORROW-002] `RefCell<PPO>` × 2 — `crates/ml/src/validation/ppo_adapter.rs:37,164`. Docstring says "interior mutability because several PPO operations require…". Verify it's single-threaded (validation harness only); if so classify as justified-unsafe with documented invariant. If multi-threaded, UB. — S=5 B=3 E=3 score=5.0
|
||||
|
||||
### CPURO (severity 5 — CPU reads of GPU-resident data on hot path)
|
||||
@@ -142,6 +142,8 @@ Target: every per-step `memcpy_htod` / `clone_htod` / `dtod_copy` on the trainin
|
||||
- [x] [DEAD-002] `opportunity_scores` dead API — iter 8 — commit 967e56c64
|
||||
- [x] [DEAD-003] orphan `transformers/features.rs` (126 LOC) — iter 8 — commit 647ff0997
|
||||
- [x] [DEAD-004] flash_attention flags (4 fields + standard_attention fallback + mask param) — iter 8 — commit 298cc33fc
|
||||
- [x] [PINMEM-007/013] dtod_copy wrappers renamed → dtod_copy_async (already async internally) — iter 10 — commit 3e8003b7f
|
||||
- [x] [BORROW-001/ROMEM-003] CudaSlice<i32>→u32 aliasing UB fixed by storing episode_ids as u32 — iter 10 — commit 8a31d3b99
|
||||
|
||||
## Known external state (NOT open findings)
|
||||
Prior WIP blocker (`set_meta_q_pred` missing method) was committed by
|
||||
|
||||
Reference in New Issue
Block a user