Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.
C#
Simulation > Frames kept in memory is "RAM cache size"
Alexander Graef352fc52876fd
diff --git a/CLAUDE.md b/CLAUDE.mdindex 9955abe..adb2b5f 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -909,8 +909,9 @@ FrameStore (temporary file in %LOCALAPPDATA%\WaveDudeNext\cache, DeleteOnClose,outgoing run's `Store.RamBytes`, counted as available since `DiscardRun` frees it moments later (2026-10-16,found on the 16 GB laptop: measured next to the old 5.4 GB store, a half-resolution re-run that fit whole inRAM got a 0.6 GB budget and spilled 90 % to the HDD; the workstation's re-runs hit the disk the same way; the- arithmetic is a pure internal overload that `library_check` checks exactly); Simulation > Frames- kept in memory (2026-10-15, the user's design after the three-step share read as crude) offers "Auto" (the+ arithmetic is a pure internal overload that `library_check` checks exactly); Simulation > RAM cache+ size (2026-10-15, the user's design after the three-step share read as crude; "Frames kept in memory" until+ 2026-10-16, renamed on the user's word since the cache is what it sizes) offers "Auto" (thesame word in every language) and 10 % to 100 % of the physical RAM as an upper bound on top of that, thesetting `FrameMemoryPercent` with 0 = Auto, the default (a `user.config` from before keeps its 50 untilthe user picks Auto); the submenu is generated from `MainWindow.FrameMemoryOptions` with thediff --git a/WaveDudeNext.WPF/Commands/SimulationCommands.cs b/WaveDudeNext.WPF/Commands/SimulationCommands.csindex 74900c1..711b8dd 100644--- a/WaveDudeNext.WPF/Commands/SimulationCommands.cs+++ b/WaveDudeNext.WPF/Commands/SimulationCommands.cs@@ -37,7 +37,7 @@ public static class SimulationCommandspublic static readonly RoutedUICommand EnsureRun = new("Run if needed", nameof(EnsureRun), typeof(SimulationCommands));/// <summary>Sets the share of the memory a run's frames may take (the parameter: a percentage as text); the Simulation menu's choices.</summary>- public static readonly RoutedUICommand SetFrameMemory = new("Frames kept in memory", nameof(SetFrameMemory), typeof(SimulationCommands));+ public static readonly RoutedUICommand SetFrameMemory = new("RAM cache size", nameof(SetFrameMemory), typeof(SimulationCommands));/// <summary>Stops the run; the frames computed so far stay in the preview. Shift+F5, or Escape (the usual "stop what you are doing" key, and reachable without a modifier).</summary>public static readonly RoutedUICommand Stop = new("Stop", nameof(Stop), typeof(SimulationCommands),diff --git a/WaveDudeNext.WPF/Converters/FrameMemoryOptionConverter.cs b/WaveDudeNext.WPF/Converters/FrameMemoryOptionConverter.csindex ff363ac..c0d34db 100644--- a/WaveDudeNext.WPF/Converters/FrameMemoryOptionConverter.cs+++ b/WaveDudeNext.WPF/Converters/FrameMemoryOptionConverter.cs@@ -23,7 +23,7 @@ using WaveDudeNext.Runs;namespace WaveDudeNext.WPF.Converters;/// <summary>-/// The header of a Simulation > Frames kept in memory entry: "Auto" (the string table's+/// The header of a Simulation > RAM cache size entry: "Auto" (the string table's/// <c>MenuSimulationFrameMemoryAuto</c>) for <see cref="FrameMemory.Automatic"/>, else the percentage of the/// RAM, "10 %" to "100 %". A multi-value converter whose first input is the option and whose second, the/// current language, only serves to re-read the resource on a language switch (2026-10-15).diff --git a/WaveDudeNext.WPF/MainWindow.Simulation.cs b/WaveDudeNext.WPF/MainWindow.Simulation.csindex f4ad10b..4979309 100644--- a/WaveDudeNext.WPF/MainWindow.Simulation.cs+++ b/WaveDudeNext.WPF/MainWindow.Simulation.cs@@ -63,7 +63,7 @@ public partial class MainWindow}/// <summary>- /// The choices of Simulation > Frames kept in memory: <see cref="FrameMemory.Automatic"/> (the application+ /// The choices of Simulation > RAM cache size: <see cref="FrameMemory.Automatic"/> (the application/// decides from what is free) and 10 % to 100 % of the RAM as an upper bound (2026-10-15, the user's design)./// </summary>public static int[] FrameMemoryOptions { get; } = [FrameMemory.Automatic, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];diff --git a/WaveDudeNext.WPF/MainWindow.xaml b/WaveDudeNext.WPF/MainWindow.xamlindex 299d7ca..36f1623 100644--- a/WaveDudeNext.WPF/MainWindow.xaml+++ b/WaveDudeNext.WPF/MainWindow.xaml@@ -93,7 +93,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or</Setter></Style><!-- one entry per theme: check mark follows the current theme, click selects -->- <!-- Simulation > Frames kept in memory: "Auto" and 10 % to 100 % of the RAM as an upper bound (2026-10-15); the+ <!-- Simulation > RAM cache size: "Auto" and 10 % to 100 % of the RAM as an upper bound (2026-10-15); theheader re-reads its word on a language switch through the second binding --><Style x:Key="FrameMemoryMenuItemStyle" TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}"><Setter Property="Header">diff --git a/WaveDudeNext.WPF/MainWindow.xaml.cs b/WaveDudeNext.WPF/MainWindow.xaml.csindex ee48264..bd2eb62 100644--- a/WaveDudeNext.WPF/MainWindow.xaml.cs+++ b/WaveDudeNext.WPF/MainWindow.xaml.cs@@ -101,7 +101,7 @@ public partial class MainWindow : Window}else if (args.PropertyName == nameof(Settings.FrameMemoryPercent)){- Logger.Info("Frames kept in memory: {Bound}, {Budget} right now (Simulation menu)",+ Logger.Info("RAM cache size: {Bound}, {Budget} right now (Simulation menu)",Settings.Default.FrameMemoryPercent <= FrameMemory.Automatic ? "automatic (what is free minus " + FrameMemory.Gigabytes(FrameMemory.Margin) + ")" : "at most " + Settings.Default.FrameMemoryPercent + " % of the RAM",FrameMemory.Gigabytes(FrameMemory.Budget(Settings.Default.FrameMemoryPercent)));}@@ -353,7 +353,7 @@ public partial class MainWindow : Windowreturn dialog.ShowDialog(this) == true && SaveFile(dialog.FileName);}- /// <summary>Simulation > Frames kept in memory: the chosen share of the RAM, applied to the next run.</summary>+ /// <summary>Simulation > RAM cache size: the chosen share of the RAM, applied to the next run.</summary>private void OnSetFrameMemory(object sender, ExecutedRoutedEventArgs e) => SetIntSetting(e, percent => Settings.Default.FrameMemoryPercent = percent);/// <summary>View > Preview resolution: the canvas divisor (1, 2, 4), applied to the next scratch frame and run.</summary>diff --git a/WaveDudeNext.WPF/Strings/Strings.DE.xaml b/WaveDudeNext.WPF/Strings/Strings.DE.xamlindex e2bdea8..ccc3a48 100644--- a/WaveDudeNext.WPF/Strings/Strings.DE.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.DE.xaml@@ -72,7 +72,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationStop">S_topp</s:String><s:String x:Key="MenuSimulationUseGpu">_GPU verwenden (OpenCL)</s:String><s:String x:Key="MenuSimulationAutoRerun">Nach Änderungen _automatisch neu starten</s:String>- <s:String x:Key="MenuSimulationFrameMemory">Bilder im Arbeits_speicher</s:String>+ <s:String x:Key="MenuSimulationFrameMemory">Größe des RAM-_Caches</s:String><s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Hilfe</s:String><s:String x:Key="MenuHelpAbout">_Über WaveDude Next</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.EN.xaml b/WaveDudeNext.WPF/Strings/Strings.EN.xamlindex f7247a9..f306896 100644--- a/WaveDudeNext.WPF/Strings/Strings.EN.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.EN.xaml@@ -74,7 +74,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationStop">S_top</s:String><s:String x:Key="MenuSimulationUseGpu">Use the _GPU (OpenCL)</s:String><s:String x:Key="MenuSimulationAutoRerun">Re-run _automatically after edits</s:String>- <s:String x:Key="MenuSimulationFrameMemory">Frames kept in _memory</s:String>+ <s:String x:Key="MenuSimulationFrameMemory">RAM _cache size</s:String><s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Help</s:String><s:String x:Key="MenuHelpAbout">_About WaveDude Next</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.FR.xaml b/WaveDudeNext.WPF/Strings/Strings.FR.xamlindex 614baaa..f055aa6 100644--- a/WaveDudeNext.WPF/Strings/Strings.FR.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.FR.xaml@@ -72,7 +72,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationStop">_Arrêter</s:String><s:String x:Key="MenuSimulationUseGpu">Utiliser le _GPU (OpenCL)</s:String><s:String x:Key="MenuSimulationAutoRerun">Relancer a_utomatiquement après une modification</s:String>- <s:String x:Key="MenuSimulationFrameMemory">Images gardées en _mémoire</s:String>+ <s:String x:Key="MenuSimulationFrameMemory">Taille du _cache RAM</s:String><s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Aide</s:String><s:String x:Key="MenuHelpAbout">À _propos de WaveDude Next</s:String>diff --git a/WaveDudeNext.WPF/Strings/Strings.NL.xaml b/WaveDudeNext.WPF/Strings/Strings.NL.xamlindex b295792..6622fc3 100644--- a/WaveDudeNext.WPF/Strings/Strings.NL.xaml+++ b/WaveDudeNext.WPF/Strings/Strings.NL.xaml@@ -72,7 +72,7 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<s:String x:Key="MenuSimulationStop">S_toppen</s:String><s:String x:Key="MenuSimulationUseGpu">_GPU gebruiken (OpenCL)</s:String><s:String x:Key="MenuSimulationAutoRerun">Na bewerkingen _automatisch opnieuw starten</s:String>- <s:String x:Key="MenuSimulationFrameMemory">Beelden in het ge_heugen</s:String>+ <s:String x:Key="MenuSimulationFrameMemory">Grootte van de RAM-_cache</s:String><s:String x:Key="MenuSimulationFrameMemoryAuto">_Auto</s:String><s:String x:Key="MenuHelp">_Help</s:String><s:String x:Key="MenuHelpAbout">_Over WaveDude Next</s:String>