Repository navigation
Client hooks: load game code before the GPU build, a game log sink, default limits within the adapter's - #16
Merged
Merged
Conversation
…efault limits within the adapter's For ThreeRT Client (taichi-dev/ThreeRT-Client), which runs games fetched as packages: - GameSession::load_code (a bundle, or a game module on the runtime module), files, start_loaded, open_loaded: the client runs setup, fetches the files the scene reads, then builds the GPU scene. start / open are now these steps. - script::set_log_sink: game console lines also go to a callback (the client's log panel, its dev server). - gpu.rs: the default limits are lowered where the adapter cannot meet them (the iOS Simulator allows 15 inter-stage variables, not 16). On desktop GPUs nothing changes (Apple M5: identical limits). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 74cd7ba. Configure here.
|
|
||
| /// Files the built scene reads from the asset root (models, file textures, procedural assets). | ||
| pub fn files(&self) -> Vec<String> { | ||
| self.host.world.borrow().files() |
There was a problem hiding this comment.
files() omits pending voxel assets
Medium Severity
GameSession::files() only forwards World::files(), but voxel level URIs sit in VoxelWorld's pending LevelDesc until start_loaded / open_loaded call realize. The client is meant to fetch from files() before that GPU build, so voxel games never list their .tpg assets and realize_voxels then fails against an empty asset root.
Reviewed by Cursor Bugbot for commit 74cd7ba. Configure here.
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.


Engine side of ThreeRT Client (taichi-dev/threert-client: the macOS / iOS apps, the
threertCLI, the pairing relay and the playground; free, closed source). The client pins this repo as itsengine/submodule and needs three small hooks. This was serverless-agent-test#139, which carried the client too; the client now lives in its own repo.What
GameSession::load_code(GameCode, room), plusfiles(),start_loaded(...)andopen_loaded(...). A client runs the game's setup first, fetches the files the scene reads from the package's origin, and only then builds the GPU scene.GameCodetakes a one-script bundle, or a game ES module on the runtime module (the form the web playground sends).start/openare nowload+start_loaded/open_loaded, with the same behaviour.script::set_log_sink(Option<fn(&str, &str)>): gameconsole.*lines also go to a callback. The client shows them in its log and sends them tothreert dev's terminal. Stderr output is unchanged.gpu.rs:Limits::default().or_worse_values_from(&adapter.limits()). The default limits are lowered only where the adapter cannot meet them. The iOS Simulator allows 15 inter-stage variables, not 16, so the device was refused there. On Apple M5 the clamped limits equal the defaults (checked), so desktop devices are created exactly as before.Tier: R1
Additive API, no shader or live-pass change.
Merge gate
cargo build --release --locked·cargo test --release --locked(renderer)cargo build --release --locked --lib --target wasm32-unknown-unknowntools/perf-smoke.ts --basemain 57d3ea2, Bistro night, 0.5 floor)npm run typecheck·npm testtest:renderThe client repo (taichi-dev/threert-client) builds and runs against this branch: macOS app, iOS Simulator, the CLI loop and the pairing end-to-end test.
🤖 Generated with Claude Code
Note
Low Risk
Additive public APIs and conservative limit clamping; existing
start/openbehavior preserved via delegation with no shader or render-path changes.Overview
Adds client-facing hooks so native apps can run scene setup, discover asset paths, and observe game logs before touching the GPU.
Game session loading is split:
GameSession::load_code(GameCode, room)runs the bundle or ES-module pair and builds the JS scene only. Callers can readfiles()and fetch assets, then callstart_loaded/open_loaded(or keep usingstart/open, which now delegate to load + loaded).GameCodedistinguishes a one-script bundle from separategame+runtimemodules.Logging:
script::set_log_sinkregisters a callback that receives everyconsole.*line in addition to stderr;__host_loginvokes it when set.GPU init: device limits start from defaults but use
Limits::default().or_worse_values_from(&adapter.limits())so caps the adapter cannot satisfy (e.g. iOS Simulator inter-stage variables) do not block device creation; desktop adapters are unchanged per PR notes.Reviewed by Cursor Bugbot for commit 74cd7ba. Bugbot is set up for automated code reviews on this repo. Configure here.