Repository: neo4j-labs/graph (language: rust)

Issue:
Replace usize with u64 in algo apps
Binaries in `graph_app` use either `u32` or `usize`. We should replace the usages of `usize` with `u64` to make it more explicit.


Discussion / hints:

Fix patch:
diff --git a/crates/app/src/loading.rs b/crates/app/src/loading.rs
index 4ab089c5..0a42a674 100644
--- a/crates/app/src/loading.rs
+++ b/crates/app/src/loading.rs
@@ -35,7 +35,7 @@ where
     if use_32_bit {
         run_direction::<u32, EV>(undirected, path)
     } else {
-        run_direction::<usize, EV>(undirected, path)
+        run_direction::<u64, EV>(undirected, path)
     }
 }
 
diff --git a/crates/app/src/page_rank.rs b/crates/app/src/page_rank.rs
index d38d806f..ac9e88f5 100644
--- a/crates/app/src/page_rank.rs
+++ b/crates/app/src/page_rank.rs
@@ -29,10 +29,10 @@ pub(crate) fn page_rank(args: CommonArgs, config: PageRankConfig) -> Result<()>
             run::<u32, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
         }
         (false, FileFormat::EdgeList) => {
-            run::<usize, _, _>(path, EdgeListInput::default(), runs, warmup_runs, config)
+            run::<u64, _, _>(path, EdgeListInput::default(), runs, warmup_runs, config)
         }
         (false, FileFormat::Graph500) => {
-            run::<usize, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
+            run::<u64, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
         }
     }
 }
diff --git a/crates/app/src/serialize.rs b/crates/app/src/serialize.rs
index aa8d6f6e..5c336cc6 100644
--- a/crates/app/src/serialize.rs
+++ b/crates/app/src/serialize.rs
@@ -30,12 +30,12 @@ pub(crate) fn serialize(args: CommonArgs, undirected: bool, output: PathBuf) ->
         if use_32_bit {
             run::<UndirectedCsrGraph<u32>, _>(path, output)?;
         } else {
-            run::<UndirectedCsrGraph<usize>, _>(path, output)?;
+            run::<UndirectedCsrGraph<u64>, _>(path, output)?;
         }
     } else if use_32_bit {
         run::<DirectedCsrGraph<u32>, _>(path, output)?;
     } else {
-        run::<DirectedCsrGraph<usize>, _>(path, output)?;
+        run::<DirectedCsrGraph<u64>, _>(path, output)?;
     }
 
     Ok(())
diff --git a/crates/app/src/sssp.rs b/crates/app/src/sssp.rs
index e7a8af32..3480fcf4 100644
--- a/crates/app/src/sssp.rs
+++ b/crates/app/src/sssp.rs
@@ -22,7 +22,7 @@ pub(crate) fn sssp(args: CommonArgs, config: DeltaSteppingConfig) -> Result<()>
     if use_32_bit {
         run::<u32>(path, runs, warmup_runs, config)
     } else {
-        run::<usize>(path, runs, warmup_runs, config)
+        run::<u64>(path, runs, warmup_runs, config)
     }
 }
 
diff --git a/crates/app/src/triangle_count.rs b/crates/app/src/triangle_count.rs
index 0cfabb9c..897ec3bc 100644
--- a/crates/app/src/triangle_count.rs
+++ b/crates/app/src/triangle_count.rs
@@ -28,10 +28,10 @@ pub(crate) fn triangle_count(args: CommonArgs, relabel: bool) -> Result<()> {
             run::<u32, _, _>(path, Graph500Input::default(), runs, warmup_runs, relabel)
         }
         (false, FileFormat::EdgeList) => {
-            run::<usize, _, _>(path, EdgeListInput::default(), runs, warmup_runs, relabel)
+            run::<u64, _, _>(path, EdgeListInput::default(), runs, warmup_runs, relabel)
         }
         (false, FileFormat::Graph500) => {
-            run::<usize, _, _>(path, Graph500Input::default(), runs, warmup_runs, relabel)
+            run::<u64, _, _>(path, Graph500Input::default(), runs, warmup_runs, relabel)
         }
     }
 }
diff --git a/crates/app/src/wcc.rs b/crates/app/src/wcc.rs
index baeed116..064a2080 100644
--- a/crates/app/src/wcc.rs
+++ b/crates/app/src/wcc.rs
@@ -30,10 +30,10 @@ pub(crate) fn wcc(app_args: CommonArgs, config: WccConfig) -> Result<()> {
             run::<u32, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
         }
         (false, FileFormat::EdgeList) => {
-            run::<usize, _, _>(path, EdgeListInput::default(), runs, warmup_runs, config)
+            run::<u64, _, _>(path, EdgeListInput::default(), runs, warmup_runs, config)
         }
         (false, FileFormat::Graph500) => {
-            run::<usize, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
+            run::<u64, _, _>(path, Graph500Input::default(), runs, warmup_runs, config)
         }
     }
 }


Test patch: