Add -substeps: trade solver accuracy for CPU headroom on slower hardware - #40
Merged
Merged
Conversation
substeps (native: 3, wasm: 1) was a const tuned for each build target's own measured per-step cost, with no way to adjust it for hardware in between -- a Raspberry Pi 5, for instance, running the exhibit's actual 24-mic acoustic localization display alongside kutta, benefits from trading a substep or two for headroom. Converts both build-tagged consts to vars and adds -substeps to override either one at runtime, no rebuild needed. Validated on-device: dropping from 3 to 2 on a Pi 5 cut solver time from ~15ms to ~10-11ms per tick (measured with -debug), the difference between visibly catching up to the tick rate and visibly falling behind it, at the cost of the accuracy that one fewer LBM step per displayed frame represents.
crgimenes
approved these changes
Aug 3, 2026
crgimenes
left a comment
Owner
There was a problem hiding this comment.
Validated on the hardware that motivated it, and the flag composes with -tps/-warp correctly. Merging, thanks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #39.
Converts both build-tagged `substeps` consts to vars and adds `-substeps` to override either one at runtime, no rebuild needed.
Validated on-device: dropping from 3 to 2 on a Pi 5 cut solver time from ~15ms to ~10-11ms per tick (measured with `-debug`) — the difference between visibly catching up to the tick rate and visibly falling behind it, at the cost of the accuracy that one fewer LBM step per displayed frame represents.
Tested: `go test ./...` passes, plus a native and WASM build (this touches both build-tagged files).