feat: background page compilation + async scene import - #15
Merged
Conversation
Replace synchronous page compilation (blocking main thread during Micromark parse + MDX compile) with a background daemon worker that greedily compiles all pages after world load. Changes: - Add CompileWorker: single daemon thread with priority queue, ConcurrentHashMap cache, GuideRegistry-based guide lookup - LytHost: remove preheat machinery (queue, scheduler, compiler lambda), split nodeResults from PageCacheEntry into 32-entry access-order LRU - GuideScreen: remove setPreheatCompiler, add async loading path with loading document, delegate to CompileWorker - MutableGuide: wrap compiledPagesStrong with Collections.synchronizedMap for thread safety, add getCachedCompiledPage() - ClientProxy: add CompileWorker singleton + getWorker(), remove LytHostPreheatItem registration - GuideLightweightReloadService: trigger worker.reset() on F3+T reload - Delete LytHostPreheatItem (replaced by CompileWorker)
…import - MaterializeTask: remove firstCall, support unlimited yields, log exceptions - ScriptContext: timeToYield pure check, explicit yield() method, replaceError() - AsyncWorker: 4-thread daemon pool for background computation - CompileWorker: persistent poll loop, remove submitIfIdle - SceneScript: 3-phase state machine (SCAN->POLL->COMPILE) using AsyncWorker - ImportStructure: check SnbtPreParseCache for worker pre-parsed SNBT - SnbtPreParseCache: ConcurrentHashMap cache for pre-parsed SNBT data
Show loading progress bar overlay during async structure imports. Reuse scene object across SCAN→POLL→COMPILE so the user sees a consistent frame from the start. - SceneScript: create scene skeleton in doScan, reuse in doCompile, ctx.replace once for async path - LytGuidebookScene: drawLoadProgressOverlay with amber progress bar and import count status text - Minor log level adjustments (warnAlways/infoAlways→info)
…ugh ScenePlaceholder SceneScript created a runtime PageCompiler via the 5-arg constructor which hardcodes LangUtil.ENGLISH_LANGUAGE, causing Ponder scene labels and annotations to always display in English regardless of game language. Fix: Store the compile-time language in ScenePlaceholder and pass it to the 6-arg PageCompiler constructor in SceneScript.
- Add GuideNavBar.activateGuide() as single state-switch entry point (save old guide state, load new guide state, expand ancestors, rebuild once) - Add activeGuideId field to track which guide currently owns expandedPageIds - NavigationState: HOME_KEY sentinel for null guideId, HOME page state now persisted - GuideScreen.rememberNavigationState: remove guide==null skip, HOME always saves - GuideScreen constructor: use activateGuide instead of restoreState - Cross-guide navigation (navigateTo/back/forward/Home): call activateGuide when guide changes; same-guide navigation preserves live expansion state - initGui: call expandNavigationParentsToCurrentPage for external screen openers (guide item, hotkey) where tree wasn't available during construction
- add GuideExpansionListener callback to GuideNavBar for write-through persistence of expand/collapse state, preventing stale state restoration on guide re-entry - add carryOverIds parameter to activateGuide(), preserve expanded state across cross-guide navigation and back/forward history - make scrollY continuous across cross-guide navigation by only restoring saved scroll during initial screen setup (tree==null) - add updateSavedExpansionState() for surgical state updates without overwriting other expanded nodes
Windorain
force-pushed
the
compiler-optimization
branch
from
June 17, 2026 14:57
5c5fb84 to
3b26d18
Compare
ABKQPO
approved these changes
Jun 17, 2026
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.
Background compilation + async scene import
Navigation state fixes
activateGuide()boundary with carry-over, properly scoping expanded page IDs and scroll position per guideGuideExpansionListenercallback ensures expand/collapse state is persisted immediately, preventing stale state restoration when re-entering a guideOther fixes
ScenePlaceholder)nei-custom-diagramtocompileOnlyApito preventNHItemListcrash