Turning thread kernel: a NaN pitch passes the pitch guard and gives a NaN toolpath as Ok
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Read crates/motion/src/turning/thread.rs around line 133 and the existing tests in crates/motion/tests/turning/turning_thread.rs. Add the provided NaN pitch test and run the turning thread tests; the issue says the test should pass as a pinning test when the kernel rejects non-finite pitch. The report also identifies similar guards for depth and infeed, but says those were not tested.
Written by the indexing model from the issue text.
Description
What happens
Turning thread kernel: a NaN pitch passes the pitch guard and gives a NaN toolpath as Ok.
Fix
Make the kernel guard refuse a non-finite pitch (!(p.pitch > 0.0 && p.pitch.is_finite())), the same rule as the app's pos() check.
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] missing refusal - crates/motion/src/turning/thread.rs:133
Test (added to crates/motion/tests/turning/turning_thread.rs, not committed):
#[test]
fn averify_f2_nan_pitch() {
let mut p = th(14.3, 7.7);
p.pitch = f64::NAN;
let e = thread(&threaded(), &p).expect_err("non-finite pitch");
assert!(format!("{e:?}").contains("pitch"), "{e:?}");
}
Result: FAILED. thread returned Ok(Toolpath) with 10 moves, and all positions between the first and last move are NaN. cycles is empty, and the note is "threading: the passes did not lay as planned - no thread cycle record".
Reasoning: p.pitch <= 0.0 is false for NaN, so the guard does not fire. The kernel then sends out a NaN toolpath as Ok. A user cannot reach this from the app: crates/app/src/operation/types/sane.rs:1276 checks pos(*pitch), and pos (line 138) is v.is_finite() && v > 0.0. So this is a kernel guard that does not catch non-finite numbers. P7 is correct, but a direct caller of the kernel API gets bad output with no error. The fix should replace the check with !(p.pitch.is_finite() && p.pitch > 0.0). The same fix applies to depth and infeed, which have the same <= 0.0 form. I did not test those two. No open issue covers it.
Cleanup: I removed the worktree .claude/worktrees/averify-4653008 and the ref refs/verify/audit-4653008. Nothing was written to GitHub.
Done means
The test above passes as a pinning test.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NeoTech/Camcraft
-
area:ui effort:medium enhancement P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug effort:high P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
NeoTech/Camcraft#4736 · 1 comment ·
Maintainers usually reply within 1 day
-
area:sim bug effort:medium P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Cutting data: refuse a tool diameter that is not positive and finite before computing speed and feedOpenbug effort:high P7
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NeoTech/Camcraft#4616 · 1 comment ·
Maintainers usually reply within 1 day
-
area:2d bug effort:high P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
All issues in NeoTech/Camcraft
Similar issues
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Possibly taken @ealwanlee claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
psmux/psmux-plugins#47 ·
-
Link Checker ReportOpenautomated issue report
Difficulty 1/5 Under an hour Newbie friendliness 76/100
ratatui/awesome-ratatui#598 ·
Maintainers usually reply within 1 day
-
area:core priority:high status:ready type:security
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
release
Difficulty 1/5 Under an hour Newbie friendliness 75/100
github/gh-aw-mcpg#17603 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day