Repository navigation
Conversation
The debug button flipped reactiveDebugParams.smartCull, one half of an AND whose other half (worldRendererConfig.smartCull) had no UI and defaulted to false — so the feature could only be turned on from the console. The button now writes the new persisted rendererSmartCull option, which is the same switch as the settings screen.
📝 WalkthroughWalkthroughThe renderer Smart Cull setting is now stored in ChangesSmart Cull configuration and runtime integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
package.jsonParsing error: ESLint was configured to run on Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/watchOptions.ts`:
- Around line 49-55: Ensure Smart Cull is applied when the world renderer is
created, not only when watchValue observes an options change. Update the
renderer creation path in index.ts, or add an equivalent creation-time trigger,
to assign the current options.rendererSmartCull value to
window.world.reactiveDebugParams.smartCull even when the option is already
disabled.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9f6878d4-4d4a-43cc-ba4d-0072c968d1d7
📒 Files selected for processing (4)
package.jsonsrc/defaultOptions.tssrc/optionsGuiScheme.tsxsrc/watchOptions.ts
| watchValue(options, o => { | ||
| appViewer.inWorldRenderingConfig.smartCull = o.rendererSmartCull | ||
| const worldRenderer = window.world | ||
| if (worldRenderer) { | ||
| worldRenderer.reactiveDebugParams.smartCull = true | ||
| } | ||
| }) |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C 8 \
'watchOptionsAfterViewerInit|window\.world|reactiveDebugParams\.smartCull|inWorldRenderingConfig\.smartCull|resetBackend|worldRenderer' \
srcRepository: zardoy/minecraft-web-client
Length of output: 18532
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== watchOptions.ts relevant section ==\n'
cat -n src/watchOptions.ts | sed -n '1,120p'
printf '\n== optionsStorage.ts watchValue definition ==\n'
cat -n src/optionsStorage.ts | sed -n '1,200p'
printf '\n== worldRenderer assignment/usages in src/index.ts ==\n'
rg -n -C 6 'window\.world\s*=|worldRender|resetBackend|startWithBot|loadBackend' src/index.ts src/appViewer.ts src/appViewerLoad.ts
printf '\n== Smart Cull consumers in source files ==\n'
rg -n 'rendererSmartCull|smartCull|reactiveDebugParams\.smartCull|inWorldRenderingConfig\.smartCull' srcRepository: zardoy/minecraft-web-client
Length of output: 15877
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '== renderer debug menu body ==\n'
cat -n src/react/RendererDebugMenu.tsx | sed -n '1,120p'
printf '\n== rendererOptionsSync and worldRenderer files mentioning smartCull/watchers ==\n'
rg -n -C 10 'smartCull|inWorldRenderingConfig|reactiveDebugParams|worldRenderer|WorldRendererCommon' node_modules minecraft-renderer 2>/dev/null || trueRepository: zardoy/minecraft-web-client
Length of output: 6459
🏁 Script executed:
#!/bin/bash
set -euo pipefail
if [ -d node_modules/minecraft-renderer ]; then
printf '== node_modules smartCull occurrences ==\n'
rg -n -C 8 'smartCull|reactiveDebugParams|inWorldRenderingConfig' node_modules/minecraft-renderer || true
else
printf 'node_modules/minecraft-renderer directory not present\n'
fi
printf '\n== repository references with global/window objects ==\n'
rg -n -C 5 'customEvents\.(emit|on)\(|gameLoaded|worldRenderer|new World|WorldRenderer|loadBackend\s*\(' src/index.ts src/appViewer.ts src/appViewerLoad.tsRepository: zardoy/minecraft-web-client
Length of output: 6259
🌐 Web query:
minecraft-renderer smartCull reactiveDebugParams inWorldRenderingConfig documentation
💡 Result:
The terms you are inquiring about appear in two distinct contexts: the official Minecraft Java Edition engine and the third-party JavaScript library 'minecraft-renderer'. In the official Minecraft Java Edition, 'smartCull' refers to a rendering optimization feature (often identified as chunk culling) that can be toggled via debug hotkeys, such as F3 + L [1][2]. It is exposed in the game's client-side code as a boolean property, 'smartCull', within the Minecraft class [3][4]. In the context of the 'minecraft-renderer' library (a JavaScript/TypeScript renderer for Minecraft data), 'inWorldRenderingConfig' is a configuration object used to manage rendering settings [5][6]. Based on the library's official documentation, the 'WorldRendererConfig' interface includes settings for performance (e.g., 'mesherWorkers'), rendering (e.g., 'enableLighting', 'fov'), and debugging (e.g., 'showChunkBorders', 'enableDebugOverlay') [5][7]. There is no standard or widely documented single configuration string or object combining 'smartCull', 'reactiveDebugParams', and 'inWorldRenderingConfig'. It is highly likely that 'reactiveDebugParams' is either a custom implementation specific to a particular project's codebase, a typo, or a misidentification of a reactive state management pattern (such as 'valtio', which the 'minecraft-renderer' library explicitly uses to synchronize 'inWorldRenderingConfig' [5][8]). If you are working with a specific codebase, you should search for 'reactiveDebugParams' directly within your project's files, as it is not part of the standard Minecraft API or the public 'minecraft-renderer' documentation.
Citations:
- 1: https://www.tcrf.net/Minecraft:_Java_Edition/Debugging_Material
- 2: https://mojira.dev/MC-301999
- 3: https://aldak0.ru/javadoc/1.21.4-21.4.136/net/minecraft/client/Minecraft.html
- 4: https://mcstreetguy.github.io/ForgeJavaDocs/1.20.6-latest/net/minecraft/client/Minecraft.html
- 5: https://github.com/zardoy/minecraft-renderer/blob/main/README.md
- 6: https://www.npmjs.com/package/minecraft-renderer
- 7: https://npm.io/package/minecraft-renderer
- 8: https://npmx.dev/package/minecraft-renderer
🌐 Web query:
site:github.com/zardoy/minecraft-renderer smartCull reactiveDebugParams inWorldRenderingConfig
💡 Result:
The terms smartCull, reactiveDebugParams, and inWorldRenderingConfig are associated with the zardoy/minecraft-renderer project, which is a library for rendering Minecraft-style worlds in the browser [1][2]. inWorldRenderingConfig This is a configuration object used within the renderer to control various aspects of world rendering, performance, and debugging [1]. It is part of the system managed by the library's main thread and is synchronized with off-thread backends (such as mesher workers) using valtio's syncToWorker functionality [1]. Its schema includes: - Performance settings (e.g., mesherWorkers, addChunksBatchWaitTime) [1]. - Rendering options (e.g., enableLighting, smoothLighting, fov) [1]. - Debug options (e.g., showChunkBorders, enableDebugOverlay) [1]. smartCull and reactiveDebugParams While inWorldRenderingConfig is a documented interface in the project, smartCull and reactiveDebugParams appear to be specific internal implementation details, parameters, or debug/performance flags likely found within the source code or related feature branches of this repository [3][4][5]. In the context of this renderer: - smartCull likely refers to the project's frustum and section occlusion culling systems (e.g., the section occlusion culling feature) which optimize rendering by excluding hidden or off-screen sections [3][4][5]. - reactiveDebugParams likely refers to reactive configuration parameters used to toggle debug overlays, chunk borders, or other instrumentation dynamically during runtime, often utilizing the same reactive state management (valtio) as inWorldRenderingConfig [1][6]. For authoritative details, these identifiers are best investigated directly within the source files of the zardoy/minecraft-renderer repository, specifically under src/three/ or src/graphicsBackend/ [7][3][4].
Citations:
- 1: https://github.com/zardoy/minecraft-renderer/blob/main/README.md
- 2: https://github.com/zardoy/minecraft-renderer
- 3: zardoy/minecraft-renderer@9ac6551
- 4: feat: frustum-culled draw spans + sorted global transparent buffer minecraft-renderer#37
- 5: https://github.com/zardoy/minecraft-renderer/pull/53/files
- 6: https://github.com/zardoy/minecraft-renderer/
- 7: zardoy/minecraft-renderer@066049d
🌐 Web query:
github zardoy minecraft-renderer smartCull reactiveDebugParams assignment
💡 Result:
I couldn’t find any occurrences (in the sources surfaced by this search) of the exact identifiers “smartCull” or “reactiveDebugParams” in the zardoy/minecraft-renderer GitHub code/PRs/commits that were returned. What I did find (relevant adjacent behavior) 1) Frustum culling + “draw spans” - The project has a pass that frustum-culls sections and builds visible “(start,count) draw spans” for rendering (PR “feat: frustum-culled draw spans + sorted global transparent buffer”). It also excludes sections with visible=false from the span builder. [1] - There’s also a related PR focused on legacy draw spans and cap/merge behavior. [2] 2) “Cull registry” + avoiding redundant work - Another PR explicitly mentions a “cull registry” and that it now tracks only sections with legacy geometry; plus it computes a fingerprint of the visible set to skip redundant span rebuilds. [3] 3) Debug overlay option surface (not the identifiers you asked about) - The README documents general debug/perf options such as enableDebugOverlay and showChunkBorders (but not “reactiveDebugParams”). [4] Interpretation relative to your query - It’s likely that “smartCull” and “reactiveDebugParams” either (a) exist in files not returned by this search result set, (b) were renamed, (c) live on a different branch/repo/tag, or (d) are referenced by generated/compiled artifacts not indexed by the search results we pulled. If you want, paste the exact file path(s) or commit hash(es) where you saw “smartCull” / “reactiveDebugParams” (even a screenshot/snippet). With that, I can do a targeted follow-up search to locate the assignment(s) and explain what they do. Top evidence from the current search set - Frustum-culling into draw spans and excluding visible=false sections: [1] - Culling only legacy sections + skipping redundant span rebuilds via a visible-set fingerprint: [3] - General debug options in README (no “reactiveDebugParams” here): [4]
Citations:
- 1: feat: frustum-culled draw spans + sorted global transparent buffer minecraft-renderer#37
- 2: zardoy/minecraft-renderer@fd9bfbc
- 3: perf(chunk-cull): scan only legacy sections + skip redundant span rebuilds minecraft-renderer#53
- 4: https://github.com/zardoy/minecraft-renderer/blob/main/README.md
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files | rg '(^|/)package.json$' | while read -r f; do
echo "== $f =="
sed -n '1,220p' "$f"
done
printf '\n== lockfile references to minecraft-renderer (if present) ==\n'
for f in package-lock.json npm-shrinkwrap.json pnpm-lock.yaml yarn.lock bun.lockb; do
if [ -f "$f" ]; then
echo "== $f =="
rg -n 'minecraft-renderer|zardoy/minecraft-renderer' "$f" || true
fi
doneRepository: zardoy/minecraft-web-client
Length of output: 8098
🌐 Web query:
github zardoy minecraft-renderer src/graphicsBackend/rendererOptionsSync inWorldRenderingConfig
💡 Result:
In the zardoy/minecraft-renderer project, inWorldRenderingConfig is an internal state object updated during runtime synchronization of renderer options [1][2]. It is managed via the subscribeRendererOptions function located within src/graphicsBackend/rendererOptionsSync.ts (or related modules in the graphicsBackend directory) [3][4][5]. When this function is called after the initialization of the AppViewer and backend, it synchronizes renderer settings from the application's options store to the renderer's internal configuration [1][5]. Key details regarding inWorldRenderingConfig include: - Function: It acts as the configuration source for in-world rendering behavior, updating dynamically based on changes to application settings [1][5]. - Implementation: Sync operations must be performed on the main thread only [1][2]. - Worker Compatibility: For off-thread backends, it utilizes an existing Valtio syncToWorker mechanism to propagate changes to workers; developers are explicitly instructed not to call subscribeRendererOptions directly from mesher workers [1][5]. - Context: It is part of a broader system where renderer-owned options are defined in RENDERER_DEFAULT_OPTIONS and RENDERER_OPTIONS_META in src/graphicsBackend/rendererDefaultOptions.ts [1][5].
Citations:
- 1: https://github.com/zardoy/minecraft-renderer/
- 2: https://github.com/zardoy/minecraft-renderer/blob/main/README.md
- 3: zardoy/minecraft-renderer@f8815eb
- 4: zardoy/minecraft-renderer@zardoy:5184053...zardoy:3a72c48
- 5: https://www.npmjs.com/package/minecraft-renderer
Reapply Smart Cull when the world renderer is created.
src/watchOptions.ts:49-55 applies rendererSmartCull during appViewer initialization, but window.world is bound later in src/index.ts. watchValue only re-runs when options.rendererSmartCull changes, so an already-disabled option leaves the world renderer without applying Smart Cull. Move the world-renderer reapplication to the renderer creation path, or add a separate creation-time trigger for the current option value.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/watchOptions.ts` around lines 49 - 55, Ensure Smart Cull is applied when
the world renderer is created, not only when watchValue observes an options
change. Update the renderer creation path in index.ts, or add an equivalent
creation-time trigger, to assign the current options.rendererSmartCull value to
window.world.reactiveDebugParams.smartCull even when the option is already
disabled.
The button flipped
reactiveDebugParams.smartCull, one half of an AND whose other half (worldRendererConfig.smartCull) had no UI and defaulted tofalse, so the feature could only be turned on from the console. The renderer release replaces both with a single persistedrendererSmartCulloption; the button now writes that.Summary by CodeRabbit
New Features
Bug Fixes
Tests