From 1858bf9befffa0e949f0cdd7e526a34233be37f7 Mon Sep 17 00:00:00 2001 From: shinyobjectz Date: Fri, 20 Nov 2026 16:24:00 -0800 Subject: [PATCH] fingerprint: a file with no sound track has no sound to judge Columns::sound embeds at least one clip, so a render with no audio stream got one empty clip's CLAP vector, and Modality::Sound.in_file said it had sound. Its sound axes then judged silence, and score could hold it back as a gating dropout or clip over the whole file. Sound and sound events are now in a file only when it has levels to read; the embedding is unchanged, so evidence rows and damage windows keep their features. --- systems/columns/src/tests.rs | 10 ++++++++++ systems/columns/src/window.rs | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/systems/columns/src/tests.rs b/systems/columns/src/tests.rs index 56f10a32f..0be5d8150 100644 --- a/systems/columns/src/tests.rs +++ b/systems/columns/src/tests.rs @@ -130,3 +130,13 @@ fn a_script_and_a_still_get_rows() { assert_eq!((s.sig.len(), s.dur, s.text.len()), (crate::SIG, 1.0, 0)); let _ = std::fs::remove_dir_all(&dir); } + +#[test] +fn a_file_with_no_sound_track_has_no_sound_to_judge() { + use crate::window::Modality; + // what columns() gives a render with no audio stream: one empty clip's CLAP vector, and no levels + let silent = Columns { sig: vec![0.0; SIG], clap: vec![0.0; CLAP], ..Default::default() }; + assert!(Modality::Picture.in_file(&silent) && !Modality::Sound.in_file(&silent) && !Modality::Events.in_file(&silent)); + let heard = Columns { level: vec![-30.0], ..silent }; + assert!(Modality::Sound.in_file(&heard)); +} diff --git a/systems/columns/src/window.rs b/systems/columns/src/window.rs index c19dcb583..bdd482484 100644 --- a/systems/columns/src/window.rs +++ b/systems/columns/src/window.rs @@ -48,6 +48,11 @@ impl Modality { } /// Whether a file's columns have rows this modality reads: a script has no picture, a video no text pub fn in_file(self, c: &Columns) -> bool { + // a file with no sound track still gets one empty clip's CLAP vector (lib.rs sound()), so sound is there only + // when there are levels to read: a silent render's sound axes judged nothing and flagged it as a dropout + if matches!(self, Modality::Sound | Modality::Events) && c.level.is_empty() { + return false; + } !match self { Modality::Picture | Modality::Change => &c.sig, Modality::Look => &c.look,