Repository navigation
Correct native-to-Java stream access-policy window output - #65
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.
Stream access-policy-window getters write native output through the outer stream-attribute wrapper instead of its nested window. The window output helpers also truncate the float hit ratio through an integer cast, write the miss property into the hit-property field, and narrow the byte count through an integer cast before assigning a Java long.
Pass the nested window to the output helper, use the matching JNI scalar types and assign the distinct miss-property field. Eight changed lines across driver/runtime, no signatures changed. Fresh output windows are still created when absent; caller-provided window objects are updated in place.
This complements Kowala's existing #48, which changes the input/setter path. Its exact diff was checked; this branch changes only the output/getter path and does not contain #48. That input patch applies cleanly in a separate integration worktree with its original authorship preserved. One output-conversion contribution is counted once across both APIs and the affected window fields.
Verification on Windows x86_64, RTX 4090/driver 617.42, Temurin JDK 22/JUnit 4.13.1:
9d41fb5: all six pass, zero failures/errors/skips. Direct getter runs log both rebuilt DLL paths. No setter or data allocation is needed in this independent mode.a6908ccb637e025e8dcec629cc13961d1e02ff05: optional round-trip mode passes all six cases. Four direct logged fresh/reused driver/runtime runs verify the returned allocation address, 256 bytes, exact fractional ratio 0.375, hit property 2 and miss property 1, plus cleanup. This nondefault setup depends on Pass correct object to getCudaAccessPolicyWindow #48; the getter-only reproduction does not.Independent mode:
Optional nondefault round-trip mode, after applying #48 and rebuilding both combined libraries:
Each child enables JNI checking and has a 30-second timeout. Reused-window identity is preserved. No PR48 setter changes are duplicated here.
CUDA reference: window field types and properties, stream attributes.