Repository navigation
Honor in-out capacities in driver graph enumeration - #64
Draft
RicheyWorks wants to merge 1 commit into
Draft
RicheyWorks wants to merge 1 commit into
RicheyWorks wants to merge 1 commit into
Conversation
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.
Five driver graph-list wrappers pass an uninitialized native count to CUDA instead of reading the caller's in/out capacity: graph nodes, root nodes, edges, node dependencies and dependent nodes. CUDA may receive a capacity unrelated to the allocated native arrays. The wrappers also copy to the full Java array length rather than the requested capacity and copy undefined native output even after a CUDA error.
Use one shared capacity reader to validate a nonempty count array, read the initial value only for list queries, and ensure it fits every provided output array. Initialize the native count, allocate and copy only the requested capacity, and release native storage without copying outputs when CUDA reports failure. Count-only queries keep ignoring the count's initial value; successful list queries preserve CUDA's returned count and null padding. Entries beyond requested capacity remain untouched. Document validation exceptions on all five Java entry points. No signatures change.
This is one in/out-capacity marshalling defect across five related entry points, not five counted fixes. No graph-query contribution was found in issue/PR searches. This branch is independent of the other pending JNI fixes.
37 real graph-metadata cases, each in an isolated child JVM with JNI checking and a 30-second timeout:
Verification on Windows x86_64, RTX 4090/driver 617.42, Temurin 22/JUnit 4.13.1:
9d41fb5: all 37 pass under JNI checking, zero failures/errors/skips or JNI warnings. A logged direct edge-padding run confirms the rebuilt DLL path.CUDA contract: graph management.
The regression enables JNI checking in each child and propagates the selected library path.