Verify: the crossing law drops every level-chord-versus-ramp pair, against its module doc

Open Beginner friendly
#4,698 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing-qa

Research direction

Read crates/sim/src/verify/crossing.rs around line 100 and compare its crossing predicate with the module documentation in mod.rs around line 14. Add the described failing test as a pinning test, then run the relevant crossing verification tests. Done means a level chord crossing a ramp between its end depths is reported, while grazes at either end depth remain exempt.

Written by the indexing model from the issue text.

Description

area:sim bug effort:medium P7 source:agent

What happens

Verify: the crossing law drops every level-chord-versus-ramp pair, against its module doc.

One fix

Report a level chord that crosses a ramp between its end depths; keep the exemption only for a graze at the ramp's start or end depth. Make the module doc and the code agree.

Verification on upstream main ca680c2d

The code audit #4653 found this (Grok). An Opus agent reproduced it with a failing test. Its report follows:

F2 REAL [P7, lowered from P1] law gap (crossing predicate drops every level-vs-ramp pair) - crates/sim/src/verify/crossing.rs:100

Test audit_f2_level_ramp_crossing:

let path = Toolpath { moves: vec![
    mv(Feed, (0,0,5) -> (20,20,5)), mv(Feed, (0,20,10) -> (20,0,0)),
], ..Toolpath::default() };
assert_eq!(crossing::crossed_pairs(&path, 0.05), vec![[0, 1]]);

Result: FAILED, it returned []. The control (two level feeds at z 5) gives [[0, 1]].
Reasoning: a level chord's Z span has zero width, so min(maxes) - max(mins) > 0.0 can never be true against a ramp. The module doc (mod.rs:14, "Z ranges overlap") says such a pair should be reported, but the inline comment (crossing.rs:87-95) excludes it on purpose. The comment only justifies grazes at a ramp's start or end depth, and here the crossing is at the ramp's mid-depth.
Why P7 and not P1: law (a) is a check that the path makes sense. It is not a gouge or collision check. At the crossing point the ramp tip is inside material that the level pass already cut, and laws (b), (b2) and (d3) still judge the material. No wrong output is shown, so this is a law and doc mismatch to fix, not a safety defect.

Done means

The test above passes as a pinning test, and the fix covers the whole defect class.

Dominant language
Rust
Stars
8
Forks
11
Avg merge
10h 3m
Merged PRs (30d)
927

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NeoTech/Camcraft

All issues in NeoTech/Camcraft

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.