Skip to content

Commit 267a6c4

Browse files
mkitticlaude
andcommitted
tests: Add non-power-of-2 shard shapes to benchmarks
Add (30,30,30) to large_morton_shards and (10,10,10), (20,20,20), (30,30,30) to morton_iter_shapes to benchmark the scalar fallback path for non-power-of-2 shapes, which are not fully covered by the vectorized hypercube path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2f9b0b3 commit 267a6c4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/benchmarks/test_indexing.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def read_with_cache_clear() -> None:
106106

107107
# Benchmark with larger chunks_per_shard to make Morton order impact more visible
108108
large_morton_shards = (
109-
(32,) * 3, # With 1x1x1 chunks: 32x32x32 = 32768 chunks per shard
109+
(32,) * 3, # With 1x1x1 chunks: 32x32x32 = 32768 chunks per shard (power-of-2)
110+
(30,) * 3, # With 1x1x1 chunks: 30x30x30 = 27000 chunks per shard (non-power-of-2)
110111
)
111112

112113

@@ -197,9 +198,12 @@ def read_with_cache_clear() -> None:
197198

198199
# Benchmark for morton_order_iter directly (no I/O)
199200
morton_iter_shapes = (
200-
(8, 8, 8), # 512 elements
201-
(16, 16, 16), # 4096 elements
202-
(32, 32, 32), # 32768 elements
201+
(8, 8, 8), # 512 elements (power-of-2)
202+
(10, 10, 10), # 1000 elements (non-power-of-2)
203+
(16, 16, 16), # 4096 elements (power-of-2)
204+
(20, 20, 20), # 8000 elements (non-power-of-2)
205+
(32, 32, 32), # 32768 elements (power-of-2)
206+
(30, 30, 30), # 27000 elements (non-power-of-2)
203207
)
204208

205209

0 commit comments

Comments
 (0)