From c137ce0295f22709d2f8e0d2db6543ea0c6724dd Mon Sep 17 00:00:00 2001 From: clover caruso Date: Tue, 1 Dec 2026 15:17:57 -0800 Subject: [PATCH] Wave 25 integration: wire optflow/custom_shaders cache resets, fix wasm32 Custom pop_error_scope panic, and update CameraShake ledger --- compatibility.md | 2 +- crates/engine/src/custom_shader.rs | 16 +++++++-- crates/engine/src/eval/mod.rs | 18 ++++++++++- scripts/accuracy_ledger.json | 52 +++++++++++++++--------------- 4 files changed, 57 insertions(+), 31 deletions(-) diff --git a/compatibility.md b/compatibility.md index 4925d2a85d25c0071833704d70c9e55cdd135c1d..2d1dbd35d618b473ffc724c0a0ddad11dac20b70 100644 --- a/compatibility.md +++ b/compatibility.md @@ -88,7 +88,7 @@ Fission currently supports **125** tool types across 2D/3D compositing, all with | Tool | Accuracy | Notes | | --- | --- | --- | | `Transform` | ✅ 100.0% | Motion blur sub-frame accumulation not implemented. | -| `CameraShake` | 98.6% | — | +| `CameraShake` | 99.9% | — | | `CornerPositioner` | 99.7% | — | | `PerspectivePositioner` | 99.7% | — | | `GridWarp` | 98.8%–99.6% | Magnet/Subdivision UI helpers not implemented. | diff --git a/crates/engine/src/custom_shader.rs b/crates/engine/src/custom_shader.rs index f310d755e95b83cc57fac3aa40d3fdae6616224a..0e116d97f5e8b1b5d4c5e581907fd5d3b649bb83 100644 --- a/crates/engine/src/custom_shader.rs +++ b/crates/engine/src/custom_shader.rs @@ -1000,6 +1000,15 @@ impl CustomShaderCache { self.bg_misses } + pub fn clear_bind_group_cache(&mut self) { + self.bg_cache.clear(); + self.bg_count = 0; + } + + pub fn reset_uniform_cursor(&mut self) { + self.uniform_cursor = 0; + } + fn ensure_format_layouts(&mut self, device: &wgpu::Device, format: wgpu::TextureFormat) { self.layouts.entry(format).or_insert_with(|| { let tex_entry = |binding| wgpu::BindGroupLayoutEntry { @@ -1203,6 +1212,7 @@ impl CustomShaderCache { ) -> Option { self.ensure_format_layouts(device, format); let pl = &self.layouts[&format].pl; + #[cfg(not(target_arch = "wasm32"))] let scope = device.push_error_scope(wgpu::ErrorFilter::Validation); let module = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("custom-tool-shader"), @@ -1216,11 +1226,11 @@ impl CustomShaderCache { compilation_options: Default::default(), cache: None, }); + #[cfg(not(target_arch = "wasm32"))] if pollster::block_on(scope.pop()).is_some() { - None - } else { - Some(pipeline) + return None; } + Some(pipeline) } /// Compiles and caches the compute pipeline for `program` at `format`, returning `false` diff --git a/crates/engine/src/eval/mod.rs b/crates/engine/src/eval/mod.rs index d2276adeb4c1af397be6c1cab21c648f1f8db9f8..18b09f754ab197c68d84899c9a2e07829045a46c 100644 --- a/crates/engine/src/eval/mod.rs +++ b/crates/engine/src/eval/mod.rs @@ -304,15 +304,19 @@ impl Engine { pub(super) fn reset_uniform_cursors(&self) { self.for_each_registry(|r| r.reset_uniform_cursor()); + if let Some(of) = self.optflow.get() { + of.reset_uniform_cursor(); + } } fn trim_uniform_chunks(&self) { self.for_each_registry(|r| r.trim_uniform_chunks(2)); } - pub(super) fn sync_bg_cache_with_vram_drops(&self) { + pub(super) fn sync_bg_cache_with_vram_drops(&mut self) { let drops = self.cache.vram_drops(); if drops != self.last_bg_vram_drops.get() { + self.custom_shaders.clear_bind_group_cache(); self.clear_bind_group_caches(); } } @@ -321,8 +325,12 @@ impl Engine { self.output_cache.clear(); self.sync_node_cache_budget(); self.cache.bust_all(); + self.custom_shaders.clear_bind_group_cache(); self.clear_bind_group_caches(); self.trim_uniform_chunks(); + if let Some(of) = self.optflow.get() { + of.clear_scratch(); + } #[cfg(not(target_arch = "wasm32"))] self.pipelines.borrow_mut().readback_pool.clear(); self.media.clear(); @@ -339,8 +347,12 @@ impl Engine { self.output_cache.clear(); self.sync_node_cache_budget(); self.cache.bust_all(); + self.custom_shaders.clear_bind_group_cache(); self.clear_bind_group_caches(); self.trim_uniform_chunks(); + if let Some(of) = self.optflow.get() { + of.clear_scratch(); + } #[cfg(not(target_arch = "wasm32"))] self.pipelines.borrow_mut().readback_pool.clear(); self.sprite_cache.clear(); @@ -352,6 +364,7 @@ impl Engine { self.output_cache.clear(); self.sync_node_cache_budget(); let busted = self.cache.bust_frame(frame); + self.custom_shaders.clear_bind_group_cache(); self.clear_bind_group_caches(); busted } @@ -360,6 +373,7 @@ impl Engine { self.output_cache.clear(); self.sync_node_cache_budget(); let busted = self.cache.bust_subtree(node); + self.custom_shaders.clear_bind_group_cache(); self.clear_bind_group_caches(); busted } @@ -426,6 +440,7 @@ impl Engine { } self.queue.submit(Some(encoder.finish())); self.reset_uniform_cursors(); + self.custom_shaders.reset_uniform_cursor(); #[cfg(not(target_arch = "wasm32"))] self.media.flush_upload_staging_after_submit(&self.device); self.finish_frame_scratch(visiting); @@ -502,6 +517,7 @@ impl Engine { self.queue.submit(Some(encoder.finish())); self.reset_uniform_cursors(); + self.custom_shaders.reset_uniform_cursor(); #[cfg(not(target_arch = "wasm32"))] self.media.flush_upload_staging_after_submit(&self.device); if let Some(visiting) = visiting_opt { diff --git a/scripts/accuracy_ledger.json b/scripts/accuracy_ledger.json index 63a2d959877717c67dbb2a4d1bf6f0b451b7f0ef..2662ee9ed920f98ee92909a792c4d2a365d4752b 100644 --- a/scripts/accuracy_ledger.json +++ b/scripts/accuracy_ledger.json @@ -583,24 +583,24 @@ "category": "3D Pipeline" }, "CameraShake": { - "mean_accuracy": 98.5994, - "min_accuracy": 94.2405, - "mean_alpha_accuracy": 99.1202, - "min_alpha_accuracy": 95.6046, + "mean_accuracy": 99.8575, + "min_accuracy": 99.5493, + "mean_alpha_accuracy": 99.8563, + "min_alpha_accuracy": 99.7, "frames": 12, - "timestamp": "2026-12-01T15:38:28Z", + "timestamp": "2026-12-01T23:20:03Z", "per_frame": [ { "frame": 0, "label": "defaults", - "accuracy": 98.7627, - "alpha_accuracy": 99.5602 + "accuracy": 99.8762, + "alpha_accuracy": 99.8769 }, { "frame": 1, "label": "Blend=0.7983, InvertTransform=1, ProcessBlue=0", - "accuracy": 94.2405, - "alpha_accuracy": 95.6046 + "accuracy": 99.8643, + "alpha_accuracy": 99.8397 }, { "frame": 2, @@ -611,56 +611,56 @@ { "frame": 3, "label": "RotationDeviation=0.26753", - "accuracy": 98.4528, - "alpha_accuracy": 99.2349 + "accuracy": 99.8441, + "alpha_accuracy": 99.8104 }, { "frame": 4, "label": "FilterMethod=7, ProcessWhenBlendIs00=1", - "accuracy": 99.3547, - "alpha_accuracy": 99.6216 + "accuracy": 99.5493, + "alpha_accuracy": 99.7 }, { "frame": 5, "label": "OverallStrength=0.64063, FrequencyMethod=2, YDeviation=0.45367", - "accuracy": 99.8506, - "alpha_accuracy": 99.8123 + "accuracy": 99.8611, + "alpha_accuracy": 99.8147 }, { "frame": 6, "label": "Edges=2", - "accuracy": 98.7037, - "alpha_accuracy": 99.6278 + "accuracy": 99.9172, + "alpha_accuracy": 99.9803 }, { "frame": 7, "label": "ProcessAlpha=0, FlattenTransform=1", - "accuracy": 99.0322, + "accuracy": 99.895, "alpha_accuracy": 100.0 }, { "frame": 8, "label": "ProcessRed=0, XDeviation=0.69915, Speed=0.28972", - "accuracy": 96.7559, - "alpha_accuracy": 97.5441 + "accuracy": 99.8964, + "alpha_accuracy": 99.8208 }, { "frame": 9, "label": "InvertTransform=1", - "accuracy": 98.7327, - "alpha_accuracy": 99.3809 + "accuracy": 99.8109, + "alpha_accuracy": 99.808 }, { "frame": 10, "label": "ProcessBlue=0, ProcessGreen=0", - "accuracy": 99.4475, - "alpha_accuracy": 99.23 + "accuracy": 99.9161, + "alpha_accuracy": 99.7975 }, { "frame": 11, "label": "InvertTransform=1, ProcessBlue=0, ProcessGreen=0, Randomness=0.10365, WindowMethod=1, RotationDeviation=0.21626, FilterMethod=10, ProcessWhenBlendIs00=1, OverallStrength=0.37217, FrequencyMethod=2", - "accuracy": 99.8596, - "alpha_accuracy": 99.8265 + "accuracy": 99.8597, + "alpha_accuracy": 99.8269 } ], "category": "Transform, Warp & Framing" -- 2.54.1