You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background:#83 implemented real tail-call optimization plus a hard-abort mechanism for detected infinite recursion (kMaxCallDepth/kMaxTailHops guards tripping), matching real OpenSCAD's behavior for recursion-test-function.scad and issue3118-recur-limit.scad: no further script output, an Error diagnostic, geometry empty.
Remaining gap: the diagnostic wording doesn't match byte-for-byte. Real OpenSCAD emits:
ERROR: Recursion detected calling function 'crash' in file recursion-test-function.scad, line 1
TRACE: called by 'crash' in file recursion-test-function.scad, line 3
TRACE: called by 'echo' in file recursion-test-function.scad, line 3
ChiselCAD currently emits only:
ERROR: Recursion detected calling function 'crash'
— missing the in file X, line Y location suffix (the location is tracked internally — Interpreter::recursionAbortedLoc() — but not yet included in CsgEvaluator::checkRecursionAbort()'s message) and the TRACE: called by ... call-stack lines entirely (which would need call-stack-with-locations tracking ChiselCAD doesn't currently maintain during expression evaluation).
Impact: low/cosmetic, same category as #85 (diagnostic-wording parity) — doesn't change any computed value, geometry, or control flow, only diagnostic-panel text. Confirmed via a live OpenSCAD 2021.01 binary and the actual upstream test files (fetched from openscad/openscad, not present in this repo).
Fix direction:
The in file X, line Y suffix is cheap — checkRecursionAbort() already has d.loc/d.filePath populated correctly, just needs appending to the message text to match OpenSCAD's exact phrasing.
The TRACE: lines need an actual call-stack (function name + call-site SourceLoc per frame) threaded through evalFunctionBody()'s trampoline and the ordinary recursive path, captured at the moment the guard trips. Probably fold into whatever [Low] Missing arity-mismatch / file-not-found diagnostic wording parity with OpenSCAD (cosmetic) #85 ends up doing for diagnostic-message parity generally, rather than a one-off for just this case.
Follow-up to #83.
Location:
src/lang/Interpreter.{h,cpp}(recursionAborted()/m_recursionAborted*),src/csg/CsgEvaluator.cpp(checkRecursionAbort()).Background: #83 implemented real tail-call optimization plus a hard-abort mechanism for detected infinite recursion (
kMaxCallDepth/kMaxTailHopsguards tripping), matching real OpenSCAD's behavior forrecursion-test-function.scadandissue3118-recur-limit.scad: no further script output, an Error diagnostic, geometry empty.Remaining gap: the diagnostic wording doesn't match byte-for-byte. Real OpenSCAD emits:
ChiselCAD currently emits only:
— missing the
in file X, line Ylocation suffix (the location is tracked internally —Interpreter::recursionAbortedLoc()— but not yet included inCsgEvaluator::checkRecursionAbort()'s message) and theTRACE: called by ...call-stack lines entirely (which would need call-stack-with-locations tracking ChiselCAD doesn't currently maintain during expression evaluation).Impact: low/cosmetic, same category as #85 (diagnostic-wording parity) — doesn't change any computed value, geometry, or control flow, only diagnostic-panel text. Confirmed via a live OpenSCAD 2021.01 binary and the actual upstream test files (fetched from
openscad/openscad, not present in this repo).Fix direction:
in file X, line Ysuffix is cheap —checkRecursionAbort()already hasd.loc/d.filePathpopulated correctly, just needs appending to the message text to match OpenSCAD's exact phrasing.TRACE:lines need an actual call-stack (function name + call-siteSourceLocper frame) threaded throughevalFunctionBody()'s trampoline and the ordinary recursive path, captured at the moment the guard trips. Probably fold into whatever [Low] Missing arity-mismatch / file-not-found diagnostic wording parity with OpenSCAD (cosmetic) #85 ends up doing for diagnostic-message parity generally, rather than a one-off for just this case.