test(native): host-constructible ProximityInfo for replay harness (#78)#104
Merged
Conversation
#78) Follow-up proof spike after #96. Add a non-JNI ProximityInfo constructor that accepts the same keyboard geometry as raw int/float arrays, so native host tests can build a keyboard geometry object without a live JVM/JNIEnv. Adds GestureReplayHostSeamTest.BuildsProximityInfoWithoutJNI: constructs a minimal QWERTY ProximityInfo and verifies key lookup for the 'hello' trace. Attempted to enable the full replay assertion with an in-memory dict; ASAN showed the next blocker is more fundamental than a dict asset: the open-source tree has no GestureSuggestPolicy implementation, only GestureSuggestPolicyFactory, whose factory method is null in host builds. Dictionary::getSuggestions(..., IS_GESTURE) therefore crashes at TRAVERSAL->getMaxSpatialDistance(). The disabled replay scaffold now documents that real blocker. Verification (WSL / ubuntu-like): native host ctest excluding the known FormatUtils quarantine -> 77/77 enabled tests pass, 1 disabled replay assertion.
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.
Follow-up proof spike after #96.
What
Adds a non-JNI
ProximityInfoconstructor that accepts the same keyboard geometry as raw int/float arrays, so native host tests can build keyboard geometry without a live JVM/JNIEnv.Adds
GestureReplayHostSeamTest.BuildsProximityInfoWithoutJNI: constructs a minimal QWERTYProximityInfoand verifies key lookup for thehellotrace (h/e/l/opresent,#absent). This removes the earlier JNI blocker from the replay path.What the spike proved
ProximityInfofrom raw geometry — no JNIEnv needed.Real remaining blocker
I attempted to enable
GestureReplayTest.ReplayHelloQwertywith a tiny in-memory dictionary. ASAN showed the crash is not the dictionary asset anymore — it's more fundamental:Dictionary::getSuggestions(..., IS_GESTURE)constructsSuggestwithGestureSuggestPolicyFactory::getGestureSuggestPolicy(), but this repo contains onlygesture_suggest_policy_factory.cpp(a nullable hook) and no gesture suggest policy implementation. In host builds the factory returnsnullptr, soSuggest::getSuggestionscrashes atTRAVERSAL->getMaxSpatialDistance().That means a real replay assertion requires an open/host-buildable
GestureSuggestPolicyimplementation (e.g. the future NLnet recognizer) or a test policy with the same interface. No fake green added; the replay assertion remains disabled and the code documents the blocker.Verification
WSL / ubuntu-like native host run:
ctest --test-dir /tmp/lt-replay-proof --output-on-failure -E 'FormatUtilsTest\\.TestDetectFormatVersion'Result: 77/77 enabled tests pass, 1 disabled (
GestureReplayTest.ReplayHelloQwerty).