93 lines
3.0 KiB
Markdown
93 lines
3.0 KiB
Markdown
---
|
|
name: align-linuxcnc
|
|
description: Use this skill for this CNC Web/WASM simulator whenever evaluating progress or changing LinuxCNC G-code behavior, RS274 source integration, kinematics, M428/M429/M430 remaps, tool data, modal state, parameters, tests, fixtures, build scripts, or bridge code.
|
|
---
|
|
|
|
# Align LinuxCNC
|
|
|
|
## Mission
|
|
|
|
Advance the simulator only by aligning it with LinuxCNC source behavior. The
|
|
project goal is a LinuxCNC-source-backed Web/WASM CNC simulator, not a
|
|
from-scratch compatible interpreter.
|
|
|
|
## Hard Constraints
|
|
|
|
- Port-first: prefer direct LinuxCNC source porting, trimming, wrapping, or
|
|
platform adaptation over project-authored replacements.
|
|
- Do not write independent functional CNC behavior.
|
|
- Do not use intuition or documentation as the final behavioral source.
|
|
- Before any functional change, locate LinuxCNC source in `../linuxcnc/src` or
|
|
`../linuxcnc/configs`.
|
|
- Allowed code: LinuxCNC source port/wrap/trim/adaptation, platform shims,
|
|
thin wasm/API/event bridges, generated fixtures, tests, build scripts, docs.
|
|
- Temporary smoke paths may be tested, but should shrink over time.
|
|
- Browser-side WASM filesystem access must use OPFS-backed storage.
|
|
|
|
## Work Directory
|
|
|
|
```bash
|
|
cd /home/cnc/桌面/cnc/wasm-simulator
|
|
git status --short
|
|
```
|
|
|
|
Related roots:
|
|
|
|
- Project root: `/home/cnc/桌面/cnc`
|
|
- LinuxCNC source: `/home/cnc/桌面/cnc/linuxcnc` or `$LINUXCNC_ROOT`
|
|
- LinuxCNC unit tests: `/home/cnc/桌面/cnc/linuxcnc/unit_tests`
|
|
|
|
## Required Checks
|
|
|
|
For code or generated fixture changes, run:
|
|
|
|
```bash
|
|
./test-native.sh
|
|
./test-linuxcnc-source-link.sh
|
|
```
|
|
|
|
For switchkins/remap table changes, also run:
|
|
|
|
```bash
|
|
./check-linuxcnc-switchkins-remap-table.sh linuxcnc-kinematics-source-files.txt
|
|
```
|
|
|
|
## Fast Loop
|
|
|
|
1. Pick one tiny gap.
|
|
2. Find the LinuxCNC source/config/remap.
|
|
3. Add or update a source-backed test/fixture.
|
|
4. Implement only bridge/shim/wrapper/generator changes.
|
|
5. Run required tests.
|
|
6. Report percent complete, source basis, changed files, and tests.
|
|
|
|
## Source Pointers
|
|
|
|
- RS274: `../linuxcnc/src/emc/rs274ngc/`
|
|
- Kinematics: `../linuxcnc/src/emc/kinematics/`
|
|
- Tooldata: `../linuxcnc/src/emc/tooldata/`
|
|
- Canon: `../linuxcnc/src/emc/nml_intf/canon.hh`
|
|
- Sim remaps/configs: `../linuxcnc/configs/sim/`
|
|
|
|
Useful project docs:
|
|
|
|
- `docs/linuxcnc-source-policy.md`
|
|
- `docs/linuxcnc-porting.md`
|
|
- `docs/linuxcnc-rs274-source-map.md`
|
|
- `linuxcnc-rs274-source-files.txt`
|
|
- `linuxcnc-rs274-wasm-source-files.txt`
|
|
- `linuxcnc-kinematics-source-files.txt`
|
|
|
|
## Current Baseline
|
|
|
|
Completion estimate: about 72%.
|
|
|
|
Strong areas: source manifests, native/source-linked RS274 runners, broad
|
|
G-code regression corpus, generated M428/M429/M430 switchkins remap fixtures,
|
|
Node/browser WASM smoke coverage.
|
|
|
|
Main remaining risks: smoke parser removal, Python/Boost.Python remap
|
|
replacement, dynamic loading shims, tooldata/HAL/filesystem assumptions,
|
|
continued source-backed expansion of kinematics/RTCP coverage, and real browser
|
|
verification that WASM file reads/writes persist through OPFS.
|