feat(loader): instrument_id filter + outdated test fix + sp18 fingerprint

This commit is contained in:
jgrusewski
2026-05-22 15:56:31 +02:00
parent 1764cc394b
commit 783297e002
25 changed files with 1628 additions and 55 deletions

View File

@@ -391,7 +391,7 @@ fn load_snapshots(
let mut rows: Vec<SnapshotRow> = Vec::with_capacity(max_snapshots);
'files: for file in &files {
let mut hit_limit = false;
let result = parser.parse_mbp10_streaming(file, snapshot_interval, |snap: &Mbp10Snapshot| {
let result = parser.parse_mbp10_streaming(file, snapshot_interval, None, |snap: &Mbp10Snapshot| {
if rows.len() >= max_snapshots {
hit_limit = true;
return;

View File

@@ -163,6 +163,7 @@ fn main() -> Result<()> {
let result = parser.parse_mbp10_streaming(
file,
cli.snapshot_interval,
None,
|snap: &Mbp10Snapshot| {
if n_processed >= limit {
hit_limit = true;

View File

@@ -168,7 +168,7 @@ fn main() -> Result<()> {
'files: for file in &files {
let mut hit_limit = false;
let result =
parser.parse_mbp10_streaming(file, cli.snapshot_interval, |snap: &Mbp10Snapshot| {
parser.parse_mbp10_streaming(file, cli.snapshot_interval, None, |snap: &Mbp10Snapshot| {
if rows.len() >= cli.max_snapshots {
hit_limit = true;
return;

View File

@@ -577,7 +577,10 @@ async fn main() -> Result<()> {
let per_file: Vec<Vec<_>> = {
use rayon::prelude::*;
mbp10_files.par_iter().filter_map(|file| {
match ml::features::predecoded::load_or_predecode_mbp10(file, &predecoded_dir) {
// precompute_features is the multi-symbol feature-cache
// builder; it intentionally consumes every instrument in
// each file. No filter.
match ml::features::predecoded::load_or_predecode_mbp10(file, &predecoded_dir, None) {
Ok(snapshots) => {
info!(
" {} -> {} snapshots",

View File

@@ -336,7 +336,10 @@ impl DQNTrainer {
Err(e) => { warn!(" DBN parser init failed: {e}"); return None; }
};
let mut snapshots = Vec::new();
match parser.parse_mbp10_streaming(file, 100, |snap| {
// DQN data loading predates the instrument-filter
// refactor; keep legacy all-instruments behavior
// until the DQN trainer needs filtering.
match parser.parse_mbp10_streaming(file, 100, None, |snap| {
snapshots.push(snap.clone());
}) {
Ok(_) => {

View File

@@ -124,7 +124,8 @@ fn fill_buffer(buf: &mut GpuReplayBuffer, n: usize, state_dim: usize) {
let aux_sign: CudaSlice<i32> = stream.alloc_zeros::<i32>(n).unwrap();
let aux_conf: CudaSlice<f32> = stream.alloc_zeros::<f32>(n).unwrap();
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &aux_sign, &aux_conf, n).unwrap();
let aux_outcome: CudaSlice<i32> = stream.alloc_zeros::<i32>(n).unwrap();
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &aux_sign, &aux_conf, &aux_outcome, n).unwrap();
}
#[test]

View File

@@ -2167,7 +2167,8 @@ mod gpu {
let ax: CudaSlice<i32> = stream.clone_htod(&aux_sign_host).expect("htod aux_sign");
let ac: CudaSlice<f32> = stream.alloc_zeros::<f32>(n1).expect("aux_conf alloc");
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &ax, &ac, n1)
let ao_zero: CudaSlice<i32> = stream.alloc_zeros::<i32>(n1).expect("aux_outcome alloc");
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &ax, &ac, &ao_zero, n1)
.expect("insert_batch (recovery=1)");
stream.synchronize().expect("sync after insert_batch (recovery=1)");
@@ -2186,7 +2187,8 @@ mod gpu {
let ax2: CudaSlice<i32> = stream.clone_htod(&vec![0_i32; n2]).expect("htod ax2");
let ac2: CudaSlice<f32> = stream.alloc_zeros::<f32>(n2).expect("aux_conf alloc 2");
buf.insert_batch(&sf2, &nsf2, &af2, &rf2, &df2, &ax2, &ac2, n2)
let ao2_zero: CudaSlice<i32> = stream.alloc_zeros::<i32>(n2).expect("aux_outcome alloc");
buf.insert_batch(&sf2, &nsf2, &af2, &rf2, &df2, &ax2, &ac2, &ao2_zero, n2)
.expect("insert_batch (recovery=0)");
stream.synchronize().expect("sync after insert_batch (recovery=0)");
@@ -2353,7 +2355,8 @@ mod gpu {
let ax: CudaSlice<i32> = stream.clone_htod(&aux_sign_host).expect("htod aux_sign");
let ac: CudaSlice<f32> = stream.alloc_zeros::<f32>(batch_size).expect("aux_conf alloc");
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &ax, &ac, batch_size)
let ao_zero: CudaSlice<i32> = stream.alloc_zeros::<i32>(batch_size).expect("aux_outcome alloc");
buf.insert_batch(&sf, &nsf, &af, &rf, &df, &ax, &ac, &ao_zero, batch_size)
.expect("insert_batch (mixed-env)");
stream.synchronize().expect("sync after insert_batch");