Skip to content

Commit 78aee01

Browse files
committed
Reduce egraph saturation iterations to limit growth for complex shaders
Lower the iteration count from 10 to 8 to prevent OOM/stack overflow on matrix-heavy and deeply nested shaders (e.g. sky-shader). Most optimizations converge within 4-6 iterations; the extra headroom was causing exponential e-graph growth with matrix decomposition rules.
1 parent 7054230 commit 78aee01

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • rust/spirv-tools-opt/src/direct

rust/spirv-tools-opt/src/direct/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ pub fn optimize_module_direct(module: &Module) -> Result<Module, EgglogOptError>
841841
// - DCE-aware constant folding (dead branches are identified)
842842
// - Partial DCE (RVSDG Gamma/Theta branches marked dead when condition is constant)
843843
// - Optimizations that expose new DCE opportunities
844-
let run_cmd = "(run-schedule (repeat 10 (run)))";
844+
let run_cmd = "(run-schedule (repeat 8 (run)))";
845845
egraph
846846
.parse_and_run_program(None, run_cmd)
847847
.map_err(|e| EgglogOptError::ExecutionError(e.to_string()))?;

0 commit comments

Comments
 (0)