Add --strict flag to apply command - #42
Open
Mhanz3500 wants to merge 2 commits into
Open
Conversation
shssoichiro
reviewed
Jun 8, 2026
| for (file_start, file_end, file_seed) in file_seeds { | ||
| // Find matching segments and update their seeds | ||
| for header in &mut new_headers { | ||
| if header.start_time == file_start && header.end_time == file_end { |
Member
There was a problem hiding this comment.
- Problem:
parse_grain_table(&grain_data)?already parses theEline seed into eachGrainTableSegment.random_seed, but strict mode then re-parses the same text and linearly searchesnew_headersfor every seed. For large per-frame grain tables this becomes O(n²) before processing starts, and the duplicate parsing path can drift from the library parser’s validation rules. - Suggestion: Remove the
extract_seeds_from_grain_table_textoverride path and rely onparse_grain_tablefor seed values; strict mode only needs to skip the laterDEFAULT_GRAIN_SEEDadjustment.
Mhanz3500
commented
Jun 16, 2026
Contributor
Author
|
this new commit should address the problem, for the test fixed it failed for scaling_shift set to 10 in the builder but tested 8 in the assert, I don't think it was intentional. |
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.
Using --strict, the grain seed will not be randomized per-frame, and it will keep the original seed written in the fgs table.
This enables two main things:
Combining the two you can also use it to have a mix of static and dynamic grain.