Repository navigation
Conversation
Release 3.3.0
… the scene root; glTF byte weights and cache lock Controller_JNI held the callbacks of getControllerRayAsync and getControllerForwardVectorAsync weakly, so a garbage collection before the answer dropped it. They are held strongly until called. For ViroController.onClickState receiving nothing on Quest, whose cause is not known: a ViroInput trace of each click through the input controller, the presenter and EventDelegate_JNI; the presenter holds its delegate strongly; and the menu button reaches the scene root as well as the controller's delegates. glTF: byte and short skin weights were converted to floats but described with the file's component type, which exploded the mesh. Builds through the loader's static caches are under a lock. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JoDeNibskBVXyR57tP3WdH
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.
The renderer half of the Quest fixes for the bugs the XR Demos apps (Soak Squad and others) found on Quest 3 with 3.2.3, all still present in 3.3.0. The ViroReact half is ReactVision/viro#638.
Not tested on a headset, and not built. No Quest was available, and
dl.google.comis blocked where this was written, so there was no NDK:libviro_renderer.sohas not been built with these changes. The five changed.cppfiles were type-checked with hostclang++ -fsyntax-onlyas the Android platform, against stubbed NDK headers. The WASM and iOS builds, which shareController_JNI.cpp,VROInputPresenter.h,VROLog.handVROGLTFLoader.cpp, were not compiled at all. CI's:viroreact:assembleDebugis the first real build.What changed
viroreact-controller-ray-weak-callbackViroController.onClickStatereceives nothing on Questviroreact-quest-controller-click-route(keep)viroreact-gltf-byte-weightsviroreact-gltf-static-cache(keep)onHandUpdateviroreact-quest-hand-update(keep)2.3:
Controller_JNI.cppnativeGetControllerRayAsyncandnativeGetControllerForwardVectorAsynctake a strong global reference to the callback and delete it after calling, on every path. A context that has gone answers with no ray or a zero vector, where the forward-vector call used to return without calling back. There is no native timeout: the bridge in viro#638 has one (2 s), and with a strong reference the only request that never answers is one whose render queue never runs.2.2: controller clicks
Reading the path end to end did not show where clicks to the presenter's delegate are lost while the scene-root route keeps working. What was ruled out by reading: the OpenXR input controller and its presenter are created once per renderer and never replaced, and nothing but
Controller_JNIsets the presenter's delegate. So this PR does the three things the brief asked for whatever the cause:pinput(...)logs under the logcat tagViroInput, which the bridge uses too, at: each button edge flushed inVROInputControllerOpenXR::onProcess;onButtonEventreturning early because the ray has no hit result (this drops the click for every listener);VROInputPresenter::onClick(delivered, no delegate, or clicks not enabled);EventDelegate_JNI::onClick(handed to Java, or Java object gone);nativeSetEventDelegate(set, or dropped because the context, delegate or presenter was missing);nativeEnableEventfor clicks. With viro#638's bridge lines, one press on a headset shows the last hop reached.shared_ptr. A delegate whose Java object is gone drops its events itself and says so in the trace.nativeSetEventDelegateno longer dereferences a null presenter.notifyMenuButtonalso delivers to the scene root's delegate when clicks are enabled on it. No other node hears it. Behaviour change: a scene-levelonClick/onClickStatenow fires for source 13.The haptic pulse still fires on detection. The comment at that call now says so.
2.8:
VROGLTFLoader::buildBoneWeightSourceThe converted weights are described as floats:
isFloattrue, 4 components of 4 bytes, stride 16, length16 * count. Before, the source used the accessor's component type over data that had already been converted. Also: a zero weight sum no longer divides, and the buffer is allocated withcallocbecauseVRODatafrees withfree.2.9:
VROGLTFLoaderstatic cachesThe whole build of a model already runs inside one rendering-thread task, between two
clearCachedData()calls, so on a single rendering thread two loads cannot interleave in the caches. I could not find how models mounted in the same frame corrupt each other through them. What is unprotected is two rendering threads in one process, which the VRActivity re-entry bug (brief 2.6) produces. The build is now under a mutex, released beforeinjectGLTFand before any failure callback, so a callback that starts another load cannot deadlock where dispatch is synchronous (WASM). Per-load state would be the fuller fix and is a much larger change to a 4,000-line loader that could not be built or run here.Some of the reported "stray triangles" may have been 2.8.
2.7: not attempted
There is no hand-joint data path to forward.
ViroViewOpenXRhas no hand listener and nothing calls into Java with joints. Adding one means locating 26 joints per hand every frame and crossing JNI and the bridge at 72 to 90 Hz, on the same main thread whose load is the subject of brief 2.5. That needs a design (what to send, how often) and a device, so it is left as follow-up.Smaller fixes on the way
nativeDestroyDelegatedeleted its reference asVRONode. It now usesEventDelegate_JNI.EventDelegate_JNI::onClickleaked its weak global reference when the Java object was gone.To check on a Quest 3
Build the AAR from this branch into viro#638 and use
examples/quest-input-validationthere.getControllerRayAsyncin a loop for 5 minutes under GC pressure: every request settles, none times out.adb logcat -s ViroInput: for each press the lines run fromOpenXR button edgetoEventDelegate onClick ... -> Java, and the bridge lines follow. The first missing line is where the click is lost.ViroARScene onClickStatereceives source 13.WEIGHTS_0renders identically.Follow-up
VROPlatformDispatchAsyncApplication, behind every node command on the main thread. A dedicated thread or JSI delivery, and a synchronous read of the latest controller pose, is a design proposal and not part of this PR.Generated by Claude Code