Preview "too large" gate: stop per-frame console spam, keep run_warn reliable#4210
Open
grandixximo wants to merge 2 commits into
Open
Preview "too large" gate: stop per-frame console spam, keep run_warn reliable#4210grandixximo wants to merge 2 commits into
grandixximo wants to merge 2 commits into
Conversation
The byte-size check ran in redraw(), printing every frame and re-stat'ing the file each repaint. Decide it once in load_preview() and have redraw() read a flag. The file is still parsed fully, so the run-time limit check stays valid; only drawing is suppressed.
run_warn() checks program extents from the preview parse. An aborted parse (PREVIEW_TIMEOUT or cancel) skips calc_extents(), leaving init extents, so run_warn() gives a false all-clear. Compute partial extents on abort and flag the preview incomplete so run_warn() reports it.
f41e482 to
562a771
Compare
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.
Addresses #4197.
The
File too large to load, disabling preview.spam exposed deeper issues with theGRAPHICAL_MAX_FILE_SIZEgate. Two commits.1. Decide "too large" once at load. The check ran in
redraw(), so it printed every frame and re-stat'd the file each repaint, and it only suppressed drawing (the file is parsed regardless). Now decided once inload_preview();redraw()reads a flag. No new INI, no change for normal files.2. Warn when
run_warnused a truncated preview.run_warn()checks extents from the preview parse. On an aborted parse (PREVIEW_TIMEOUTor cancel),calc_extents()is skipped, sorun_warn()gives a silent false all-clear, a latent hole today. Now it computes partial extents on abort and flags the preview incomplete, sorun_warn()reports the truncation.On segment-count (the max-segments idea): I backed off. File size is a poor proxy, but segments are not universal either (a DEBUG/MSG-only loop emits none yet still burns parse time). The honest "how much we process" measure is time, and
PREVIEW_TIMEOUTalready provides it, so I did not add a third knob.Open question:
PREVIEW_TIMEOUTis the real runaway/infinite-loop guard but is off by default and AXIS-only. With commit 2 makingrun_warnhonest, a default becomes safe (normal programs parse in well under a second). Should it get a sane default and move into the sharedcheck_abortfor all GUIs?Longer term, shaders (#3547) would remove the need for this gate.