Skip to content

Commit ffad4fa

Browse files
fix potential phantom match (#871)
* allow disabling of stream timers * bump stage image * fix potential phantom match * dbg: just for e2e * clear some more buffers * revert dbg * trigger image push * test image in stage * use rebased image * bump image --------- Co-authored-by: Ertugrul Aypek <ertugrul.aypek@toolsforhumanity.com>
1 parent 491fa3a commit ffad4fa

File tree

4 files changed

+20
-27
lines changed

4 files changed

+20
-27
lines changed

.github/workflows/temp-branch-build-and-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Branch - Build and push docker image
33
on:
44
push:
55
branches:
6-
- "ps/reuse-events"
6+
- "ps/potential-phantom-match"
77

88
concurrency:
99
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'

deploy/stage/common-values-iris-mpc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: "ghcr.io/worldcoin/iris-mpc:v0.13.8"
1+
image: "ghcr.io/worldcoin/iris-mpc:v0.13.9"
22

33
environment: stage
44
replicaCount: 1

iris-mpc-gpu/src/dot/share_db.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,10 @@ impl ShareDB {
503503
let device = self.device_manager.device(idx);
504504
device.bind_to_thread().unwrap();
505505

506-
if offset[idx] >= db_sizes[idx] || offset[idx] + chunk_sizes[idx] > db_sizes[idx] {
506+
if offset[idx] >= db_sizes[idx]
507+
|| offset[idx] + chunk_sizes[idx] > db_sizes[idx]
508+
|| chunk_sizes[idx] == 0
509+
{
507510
continue;
508511
}
509512

iris-mpc-gpu/src/server/actor.rs

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ impl ServerActor {
727727
);
728728

729729
self.device_manager.await_streams(&self.streams[0]);
730+
self.device_manager.await_streams(&self.streams[1]);
730731

731732
// Iterate over a list of tracing payloads, and create logs with mappings to
732733
// payloads Log at least a "start" event using a log with trace.id
@@ -967,12 +968,8 @@ impl ServerActor {
967968
})
968969
.unwrap();
969970

970-
// Wait for all streams before get timings
971-
self.device_manager.await_streams(&self.streams[0]);
972-
self.device_manager.await_streams(&self.streams[1]);
973-
974971
// Reset the results buffers for reuse
975-
for dst in &[
972+
for dst in [
976973
&self.db_match_list_left,
977974
&self.db_match_list_right,
978975
&self.batch_match_list_left,
@@ -981,26 +978,19 @@ impl ServerActor {
981978
reset_slice(self.device_manager.devices(), dst, 0, &self.streams[0]);
982979
}
983980

984-
reset_slice(
985-
self.device_manager.devices(),
981+
for dst in [
982+
&self.distance_comparator.all_matches,
986983
&self.distance_comparator.match_counters,
987-
0,
988-
&self.streams[0],
989-
);
990-
991-
reset_slice(
992-
self.device_manager.devices(),
993984
&self.distance_comparator.match_counters_left,
994-
0,
995-
&self.streams[0],
996-
);
997-
998-
reset_slice(
999-
self.device_manager.devices(),
1000985
&self.distance_comparator.match_counters_right,
1001-
0,
1002-
&self.streams[0],
1003-
);
986+
&self.distance_comparator.partial_results_left,
987+
&self.distance_comparator.partial_results_right,
988+
] {
989+
reset_slice(self.device_manager.devices(), dst, 0, &self.streams[0]);
990+
}
991+
992+
self.device_manager.await_streams(&self.streams[0]);
993+
self.device_manager.await_streams(&self.streams[1]);
1004994

1005995
// ---- END RESULT PROCESSING ----
1006996
if self.enable_debug_timing {
@@ -1167,7 +1157,7 @@ impl ServerActor {
11671157
let chunk_sizes = |chunk_idx: usize| {
11681158
self.current_db_sizes
11691159
.iter()
1170-
.map(|s| (s - DB_CHUNK_SIZE * chunk_idx).clamp(1, DB_CHUNK_SIZE))
1160+
.map(|s| (s - DB_CHUNK_SIZE * chunk_idx).clamp(0, DB_CHUNK_SIZE))
11711161
.collect::<Vec<_>>()
11721162
};
11731163

@@ -1220,7 +1210,7 @@ impl ServerActor {
12201210
// later.
12211211
let dot_chunk_size = chunk_size
12221212
.iter()
1223-
.map(|s| s.div_ceil(64) * 64)
1213+
.map(|&s| (s.max(1).div_ceil(64) * 64))
12241214
.collect::<Vec<_>>();
12251215

12261216
// First stream doesn't need to wait

0 commit comments

Comments
 (0)