@@ -176,6 +176,11 @@ fn generate_random_shared_irises(count: usize) -> Vec<Arc<GaloisRingSharedIris>>
176
176
. collect ( )
177
177
}
178
178
179
+ // Simulate dot-products as they occur in search_layer:
180
+ // DEPTH times we open a new candidate node, each contributing NEW_NODES_PER_LEVEL new nodes
181
+ // which are batched to compute distance to the source
182
+ // Constants are chosen according to staging runs as of late August 2025.
183
+
179
184
pub fn search_layer_like_calls ( c : & mut Criterion ) {
180
185
let mut g = c. benchmark_group ( "search_layer_like_calls" ) ;
181
186
g. sample_size ( 10usize ) ;
@@ -196,8 +201,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
196
201
|| {
197
202
let mut rng = StdRng :: seed_from_u64 ( 42 ) ;
198
203
let num_indices = DEPTH * NEW_NODES_PER_LEVEL ;
199
- let indices = sample ( & mut rng, all_irises. len ( ) , num_indices) . into_vec ( ) ;
200
- indices
204
+ sample ( & mut rng, all_irises. len ( ) , num_indices) . into_vec ( )
201
205
} ,
202
206
|mut indices| {
203
207
let initial_pairs: Vec < _ > = initial_rhs_irises
@@ -231,9 +235,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
231
235
num_threads
232
236
) ) ;
233
237
g_parallel. sample_size ( 10 ) ;
234
- g_parallel. throughput ( Throughput :: Elements (
235
- ( total_elements * num_threads as usize ) as u64 ,
236
- ) ) ;
238
+ g_parallel. throughput ( Throughput :: Elements ( ( total_elements * num_threads) as u64 ) ) ;
237
239
238
240
g_parallel. bench_function ( "identical order per thread" , |b| {
239
241
pool. install ( || {
@@ -264,7 +266,7 @@ pub fn search_layer_like_calls(c: &mut Criterion) {
264
266
let mut indices = indices_for_thread. clone ( ) ;
265
267
266
268
let initial_pairs: Vec < _ > = initial_rhs_irises
267
- . into_iter ( )
269
+ . iter ( )
268
270
. map ( |rhs| Some ( ( source_iris. clone ( ) , rhs. clone ( ) ) ) )
269
271
. collect ( ) ;
270
272
black_box ( galois_ring_pairwise_distance ( black_box ( initial_pairs) ) ) ;
0 commit comments