docs(dd): DD-017 RS274NGC parametric programs — Proposed (#189 phase 7) - #263
Merged
Conversation
Drafts the design for the largest remaining #189 gap: LinuxCNC/CAM parametric programs — numbered/named parameters (#100 = 5), expressions (X[#1 + sin[30]]), and O-word subroutines/loops/conditionals — which the forward-only line processor drops today. Key decisions for acceptance (D1–D8): - D1: on-demand program-buffered interpreter engaged ONLY when #/[ /O-words appear; FDM + simple CNC keep the untouched forward-only fast path (byte-identical). One motion/classification core; the interpreter only feeds it. - D5: two new DD-003 limits (maxProgramIterations, maxCallDepth) so a while[1] or infinite recursion can't hang/OOM the worker — bounded, no eval, no I/O. - Spec-derivable from RS274NGC (NIST IR 6556) / LinuxCNC — hardware only re-confirms; parity targets only, no spec text copied (RR-004 §6). Proposed only — architecture-sensitive, so blocked until Accepted per governance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 7, scoped as a DD for your acceptance
The largest remaining #189 gap: real LinuxCNC / CAM output uses the RS274NGC programming layer — parameters (
#100 = 5), expressions (X[#1 + 2*sin[30]]), and O-word subroutines/loops/conditionals. The parser lexes these away today (Number('[#1+5]')→NaN, dropped), so a parametric program renders partial or empty geometry.Unlike the laser semantics, this is fully spec-derivable (RS274NGC / NIST IR 6556, as-implemented by LinuxCNC) — build it right from the spec; hardware only re-confirms. But it turns the forward-only line processor into a small interpreter (symbol table + expression evaluator + control flow that re-runs/skips lines), which is architecture-sensitive → DD before code, per governance.
The decisions I'd want your call on
#,[, or leading O-word is detected. Everything else (all FDM, most simple GRBL/laser CNC) keeps the untouched forward-only fast path → byte-identical. One motion/classification core; the interpreter only feeds resolved lines into it.maxProgramIterations(~1M) andmaxCallDepth(~50) — soo while [1]or infinite recursion can't hang/OOM the worker. Pure arithmetic evaluator, noeval, no I/O.sub/call,if,while/do/repeat).parametricProgramcapability + per-construct disclosure; FDM byte-identical gate + new synthetic parametric goldens.Non-goals: external subroutine files / Fanuc
M98(no I/O), persistent.varparams, machine-config mutation, full conformance.Four open questions for acceptance are listed in §7 (capability name, limit defaults, system-param allow-list, loop-form scope). Nothing is built — this is Proposed; on acceptance the phased plan (§5) is: (1) expressions+params, (2) O-word flow+limits, (3) subroutines, (4) capability/docs.
Docs-only; links green; added to the DD index.
🤖 Generated with Claude Code