Repository navigation
Feat: Zero-copy array.array parameters with atomic element access (#149) - #225
Merged
Merged
Conversation
…mic element access (#149, WIP)
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.
Refs #149. The concurrent-resize behaviour is still awaiting a user decision, so the issue stays open. numpy is split out to #220.
Feature added:
array.array[float]andarray.array[int]parameters compile without a copy. The entry guard checks the exact type, a C-contiguous 1-D buffer with formatdorq/l, itemsize 8 and 8-byte alignment; anything else deopts before any effect.a[i]. There is no copy-in and no critical section, and no limit on the number of buffer parameters.array index out of range).-DTP_BUFFER_PLAINswitches element access to plain loads and stores, for measurement only.Not done:
NDArrayparameters stay interpreted, and a test pins that their results andnp.float64result type equal the interpreter's. Tracked in TypedPython: numpy array parameters (types, warnings and division follow numpy scalars) #220.Tests added:
test_buffer_arrays.py, 51 tests.assert_compiledwas added.appendraising BufferError, so the test fails.Measured (quiet window, 11 interleaved pairs, 2,000,000 doubles, 3.15.0rc1t;
benchmarks/typedpython/results/2026-10-17-buffer-atomic-*):Verification (local, 3.15.0rc1t):