From 24a8b4c6216f646d834d79ecf6b80179c757ad0d Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Tue, 19 May 2026 23:50:31 +0200 Subject: [PATCH] chore(ml-backtesting): allow(unsafe_code) on sim/mod.rs for cudarc launches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cudarc kernel launches require `unsafe` blocks — the driver API has no way to type-check kernel args against the cubin signature. The workspace-wide `-W unsafe-code` lint produces noise on every launch site (10+ blocks); suppressing at the module level keeps the lint useful elsewhere in the crate. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/ml-backtesting/src/sim/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/ml-backtesting/src/sim/mod.rs b/crates/ml-backtesting/src/sim/mod.rs index c842c6a5d..f4ddf8f1c 100644 --- a/crates/ml-backtesting/src/sim/mod.rs +++ b/crates/ml-backtesting/src/sim/mod.rs @@ -6,6 +6,13 @@ //! //! See docs/superpowers/specs/2026-05-18-real-lob-integration-design.md §2 + §5b. +// cudarc kernel launches are inherently `unsafe`: the driver API has no way +// to type-check kernel args against the .cubin's signature. Per +// pearl_no_host_branches_in_captured_graph + the surrounding GPU-contract +// pearls, all launches are pre-compiled and the args are matched by hand in +// review. The workspace-wide `-W unsafe-code` lint is therefore noise here. +#![allow(unsafe_code)] + mod batched_config; pub use batched_config::{BatchedSimConfig, ResolvedSimVariant, UniformSimParams};