You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypedPython: vectorise element-wise loops over array.array buffers without giving up per-element atomicity #226
Follow-up to #149/#225 (leader decision 2026-10-17: keep relaxed atomic element access; plain access is a data race in the C memory model, which N-9 does not allow).
an element-wise store loop (a[i] = a[i] * k) is 2.54x slower with relaxed atomics than with plain access, because the compiler does not vectorise atomic accesses;
a read-and-reduce loop is unaffected (1.001), since the strict-FP reduction is not vectorised anyway.
Idea to investigate: emit explicitly vectorised code whose vector loads and stores are element-wise single-copy atomic on the target (aligned NEON / SSE / AVX element accesses are single-copy atomic per element on arm64 and x86-64). Express this so the C memory model still sees per-element atomic accesses, for example a target-specific helper with a documented guarantee. Prove or measure that no tearing below 8 bytes can occur.
Done when: the scale kernel's cost is within 10% of plain access, and a design note states per target why each element access stays single-copy atomic.
Activity
Merge pull request #270 from thisisthepy/feat/tp-vec-atomic
b-re-w commentedon Oct 25, 2026
Landed in develop via #270