Skip to content

Commit 359b575

Browse files
author
igor
committed
memory/: scrub contextual leaks per the new public-fork lesson
Applied 'grep is necessary but not sufficient' to all five files in linuxcnc/memory/ via human review (per the lesson added to feedback_public_fork.md in the previous commit). reference_fork_setup.md: clean. All content is fork-side build setup or generic Linux/LinuxCNC knowledge. reference_teleop_velocity_bug.md: scrubbed multiple contextual leaks. - Symptom paragraph: removed 'With Z at HOME=500, re-homing after a jog landed at ~498 mm' (private machine config — Z homing position reveals downstream hardware) and 'Test 13 re-home consistency' (private test name). Generalized to 'sub-millimeter tolerance' and 'millimeters of deviation'. - Removed 'Why the test didn't catch this before' paragraph entirely. It described 'Phase B of this branch' (private session phasing) and the asymmetry between Z=0 (MIN_LIMIT) and Z=500 (MAX_LIMIT) — both leak private hardware configuration. Replaced with a generalized 'Why earlier tests miss this' explanation: symmetric jog/home test setups coincidentally cancel the drift; only asymmetric pairs surface it. Same lesson, no private leak. - Removed 'How to verify' section entirely. It listed assertions in test_logic.sh (Test 8b/8c, Tests 13/17/21, sim_lin_enc.so refs) that are all private cncmill1 test infrastructure not present in upstream LinuxCNC. reference_upstream_pr_workflow.md: scrubbed two minor leaks. - Tool intro: removed 'commit added on branch fizzy-forging-stardust' (private session branch name from the upstream-pr-prep helper's development history). The merge SHA stays — that's public on the fork. Branch names that don't exist on the public fork after merge are private context. - Code block comment: changed '/tmp is tmpfs on this machine, override' to 'override if /tmp is tmpfs on the host'. Removes the work-computer-specific environmental detail. Both files remain leak-free per a comprehensive grep including the new contextual-leak terms (fizzy, stonebraker, Phase B, Test 13, test_logic, HOME=500, sim_lin_enc) plus the original literal-path patterns. The five remaining linuxcnc/memory/ entries are now all fully fork-relevant with no private project structure leaks: - feedback_public_fork.md (public-fork hygiene rule + contextual-leak lesson) - reference_fork_setup.md (fork build setup) - reference_teleop_velocity_bug.md (upstream bug + fix description) - reference_upstream_pr_workflow.md (upstream PR prep procedure)
1 parent 4136478 commit 359b575

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

memory/reference_teleop_velocity_bug.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ originSessionId: 4b988890-e736-4841-9234-018b1517d7ab
88
**https://github.com/LinuxCNC/linuxcnc/pull/3933** (`motion: axis_sync_teleop_tp_to_carte_pos resets velocity/acceleration`). PR branch `fix-teleop-tp-velocity-reset` on the fork is based on `upstream/master@a2a929ccaa` and contains exactly one commit (`47abd6ac66`), authored as `is-primary-dev <215415441+is-primary-dev@users.noreply.github.com>`. Fork master has the same fix as `f40e8e64bc` (via merge `e4a81b19a5`). If the upstream PR gets reviewer feedback requesting changes, push fixup commits to the same fork branch; it's still checked out locally for that purpose.
99

1010
**Symptom.** After jogging an axis and then re-homing it, the homed joint
11-
lands slightly BELOW `HOME` instead of exactly at `HOME`. With Z at HOME=500,
12-
re-homing after a jog landed at ~498 mm, deterministic per jog-settle
13-
timing. Test 13 "re-home consistency" fails with ~1-3 mm max deviation.
11+
lands slightly off `HOME` instead of exactly at `HOME`. The deviation is
12+
deterministic per jog-settle timing and proportional to the residual jog
13+
velocity at the moment mode transitions from FREE (homing) to TELEOP.
14+
Re-home consistency tests with sub-millimeter tolerance fail with
15+
millimeters of deviation.
1416

1517
**Root cause** (in `linuxcnc/src/emc/motion/axis.c`):
1618
`axis_sync_teleop_tp_to_carte_pos()` updates `teleop_tp.curr_pos` and
@@ -38,17 +40,11 @@ with the function's documented intent. The fix is on fork master as
3840
commit `f40e8e64bc` (via merge `e4a81b19a5`) and submitted upstream as
3941
PR #3933.
4042

41-
**Why the test didn't catch this before.** Before Phase B of this branch,
42-
Z homed at 0 (MIN_LIMIT). The test jog direction and re-home direction
43-
coincidentally cancelled the drift. When Z started homing at 500
44-
(MAX_LIMIT) the asymmetry exposed the bug.
45-
46-
**How to verify.** The assertions added in test_logic.sh:
47-
- Test 8b/8c: `joint.{2,3}.motor-offset` within ±10mm (proves
48-
HOME_INDEX_NO_ENCODER_RESET special case fired, catches stale
49-
sim_lin_enc.so bug independently)
50-
- Tests 13/17/21: re-home consistency <1µm over multiple cycles
51-
(catches teleop_tp velocity leak on mode transition)
43+
**Why earlier tests miss this.** A symmetric test setup (jog direction
44+
equal-and-opposite to the homing search direction) coincidentally
45+
cancels the drift. The bug only surfaces when jog and re-home
46+
directions are asymmetric. Re-home consistency assertions need to
47+
exercise asymmetric jog/home pairs to catch it.
5248

5349
**Related lesson.** When a function is documented as "initialize X to a
5450
rest state," check whether it resets velocity/acceleration state, not

memory/reference_upstream_pr_workflow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ description: Use agent-helpers/upstream-pr-prep.sh to cherry-pick a fork commit
44
type: reference
55
originSessionId: 795ab1b7-ad70-4ca0-8fe0-8a6903e238a7
66
---
7-
**Tool.** `agent-helpers/upstream-pr-prep.sh` on the fork (merged to fork master 2026-04-12, commit added on branch `fizzy-forging-stardust` via merge `89f87b5a40`). **Always invoke via the wrapper subcommand** so the PreToolUse auto-approval hook covers the call. Direct invocation of `upstream-pr-prep.sh` bypasses the hook and prompts per call.
7+
**Tool.** `agent-helpers/upstream-pr-prep.sh` on the fork (merged to fork master 2026-04-12 via merge `89f87b5a40`). **Always invoke via the wrapper subcommand** so the PreToolUse auto-approval hook covers the call. Direct invocation of `upstream-pr-prep.sh` bypasses the hook and prompts per call.
88

99
```
1010
./agent-helpers/safe-agent-action.sh upstream-pr-prep \
1111
--commit <fork-sha> \
1212
--branch <pr-branch-name> \
1313
--message /tmp/upstream-commit-msg.txt \
14-
--worktree /var/tmp/linuxcnc-pr-<branch> # /tmp is tmpfs on this machine, override
14+
--worktree /var/tmp/linuxcnc-pr-<branch> # override if /tmp is tmpfs on the host
1515
[--build] [--push] [--cleanup] [--dry-run]
1616
```
1717

0 commit comments

Comments
 (0)