Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ jobs:
- run: cd python && maturin develop --release
- run: pytest python/tests/

python-lint:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
- uses: astral-sh/setup-uv@v7
- run: cd devtools-pyenv && uv sync
# ruff.toml at the root covers python/tests/, benchmark/, and
Expand Down
16 changes: 11 additions & 5 deletions benchmark/quickik_rust/src/perf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ pub fn run_all(tree: &Arc<KinematicTree>, fixtures: &Fixtures, body: &str) {
println!("-- single-frame time (latency), default config (adaptive early stop) --");
let single_frame_latency = summarize(
"solve()",
bench_single_frame_latency(tree, &target_obs, 10_000, SolverConfig::<NoMapper>::default()),
bench_single_frame_latency(
tree,
&target_obs,
10_000,
SolverConfig::<NoMapper>::default(),
),
);

// Early stop disabled (tolerances = 0), so every call runs the full
Expand Down Expand Up @@ -289,7 +294,10 @@ fn tiled_native_rate_sequence_2d(
/// `../plot/results/quickik-rust-2d-xyview-<body>.json` for
/// `../plot/plot_2d_comparison.py` to pick up.
pub fn run_all_2d(tree: &Arc<KinematicTree>, fixtures: &Fixtures, body: &str) {
println!("quickik Rust benchmark, 2D via XYView (state_dim={})\n", tree.state_dim());
println!(
"quickik Rust benchmark, 2D via XYView (state_dim={})\n",
tree.state_dim()
);

let target_obs = observations_2d_xyview(&fixtures.synthetic_frames[0].target_ego);
println!("-- single-frame time (latency), default config (adaptive early stop) --");
Expand Down Expand Up @@ -323,9 +331,7 @@ pub fn run_all_2d(tree: &Arc<KinematicTree>, fixtures: &Fixtures, body: &str) {
bench_single_frame_latency(tree, &target_obs, 10_000, max_iterations_config),
);

println!(
"\n-- single-thread sequence throughput (native-rate frames, adaptive early stop) --"
);
println!("\n-- single-thread sequence throughput (native-rate frames, adaptive early stop) --");
let single_thread_sequence = tiled_native_rate_sequence_2d(
&fixtures.native_rate_frames,
SINGLE_THREAD_N_FRAMES,
Expand Down
6 changes: 4 additions & 2 deletions tests/observation_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ fn xyview_drops_z_and_passes_through_xy() {
let mapper = XYView;
let jacobian_world3d = DMatrix::from_row_slice(3, 2, &[1.0, 0.0, 0.0, 1.0, 0.0, 0.0]);
let mut jac2d = DMatrix::<f32>::zeros(2, 2);
let pos2d = mapper.project_3d_to_2d(&Vector3::new(1.0, 2.0, 3.0), &jacobian_world3d, &mut jac2d);
let pos2d =
mapper.project_3d_to_2d(&Vector3::new(1.0, 2.0, 3.0), &jacobian_world3d, &mut jac2d);

assert_eq!(pos2d, Vector2::new(1.0, 2.0));
assert_eq!(jac2d, jacobian_world3d.rows(0, 2).into_owned());
Expand All @@ -24,7 +25,8 @@ fn camera_projects_point_directly_in_front_to_principal_point() {
};
let jacobian_world3d = DMatrix::<f32>::identity(3, 3);
let mut jac2d = DMatrix::<f32>::zeros(2, 3);
let pos2d = camera.project_3d_to_2d(&Vector3::new(0.0, 0.0, 0.0), &jacobian_world3d, &mut jac2d);
let pos2d =
camera.project_3d_to_2d(&Vector3::new(0.0, 0.0, 0.0), &jacobian_world3d, &mut jac2d);

assert!((pos2d - Vector2::new(320.0, 240.0)).norm() < 1e-4);
}
Expand Down
Loading