Fix packet scatter to raw pointers - #518
Open
jeongseok-meta wants to merge 1 commit into
Open
Conversation
jeongseok-meta
added a commit
to jeongseok-meta/drjit
that referenced
this pull request
Jul 21, 2026
jeongseok-meta
force-pushed
the
fix-raw-pointer-packet-scatter
branch
from
July 21, 2026 10:17
086a67e to
e25a39c
Compare
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.
Motivation
dr::scatter()supports packet values for Dr.Jit array targets and scalarvalues for raw-pointer targets. Combining a packet value with a raw-pointer
target currently enters
Target::scatter_packet_, which only exists forDr.Jit array targets. Pointer expressions such as
.data()also cannot bindto the current target parameter, so valid flat-buffer packet scatters fail to
compile.
This occurs in Momentum's rasterizer:
https://github.com/facebookresearch/momentum/blob/v0.1.114/momentum/rasterizer/image.cpp#L166
conda-forge currently carries patch 0004 for this behavior:
https://github.com/conda-forge/drjit-cpp-feedstock/blob/9a731565e61ff8d4373c79715ea59a606a05e2d2/recipe/patches/drjit/0004-Fix-scatter-for-raw-pointer-target.patch
Once this fix is included in an upstream Dr.Jit release, that feedstock patch
can be removed.
Changes
dispatch through the decayed target type.
including the requested reduction mode.
Packet<float, 3>scattered into a packedraw buffer.
reference regression.
Testing
drjit-python,drjit-copy-python-src,memop_ext, andcall_extpython -m pytest tests/test_memop_ext.py -vv(8 passed)python -m pytest tests/test_call_ext.py -vv(128 passed)Packet<float, 3>(sizeof=16, passed)python -m py_compile tests/test_memop_ext.pygit diff --check origin/master..HEAD