the pre-release sweep: C++ cites architecture by anchor and lint reads it, the arch tools locate instead of quote, the worker heap test measures collection, and the install lists catch up - #4047
Conversation
091b993 to
c647e2b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new C/C++ pointer scanner currently omits .c sources, so “C and C++” pointer citations are not fully supported as described.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This PR is a pre-release cleanup/sweep ahead of 0.6.4 that (1) migrates C/C++ “architecture pointers” from sec.N to validated #anchor citations (checked by LINT026), (2) reshapes MCP arch_* tools to return locations/ranges instead of quoting document text, (3) stabilizes the Strudel worker heap test by measuring actual collection signals, and (4) updates install/bundle rosters and Windows line-ending behavior for generated .das.inc files.
Changes:
- Implement anchor-based architecture citation scanning across
.dasand C/C++ comment pointers; update lint + MCP tools + docs accordingly. - Update
arch_of/arch_sitesoutputs to be coordinate-based (line ranges) and extendarch_sitescensus beyond the document subtree into C++ roots. - Fix
test_worker_heap.dasto assert collection behavior (drops + floor stability) using worker time; update install/gate rosters and enforce LF output for generated.das.inc.
File summaries
| File | Description |
|---|---|
| utils/mcp/tools/arch_sites.das | Use cited_symbol, show section line ranges, and extend census to scan C++ roots (src/include/modules/*/src). |
| utils/mcp/tools/arch_of.das | Change output from quoted section text to a locator line per citation (doc path + line span). |
| utils/mcp/tools/arch_common.das | Extend scan helpers with C/C++ roots and add cited_symbol wrapper for non-.das sources. |
| utils/mcp/registry_das.das | Update MCP tool descriptions/schemas to reflect locator-based arch_of and expanded arch_sites. |
| utils/lint/tests/lint026_arch_citations.das | Add tests covering C++ // <doc>.md#<anchor> pointer scanning and failure modes. |
| utils/lint/main.das | Extend LINT026 scan to include C/C++ sources and short-circuit on .md# for pointer-only files. |
| utils/internal/preflight/main.das | Track changed headers explicitly and include changed C++/headers in the lint gate inputs. |
| utils/internal/arch-extract/main.das | Include .md# pointer scanning trigger and broaden file scan to C/C++ sources. |
| utils/common/arch_citations.das | Add C/C++ pointer citation parsing and shared resolution behavior for lint/tools/extract. |
| tests/strudel_device/test_worker_heap.das | Replace “peak-base” heuristic with drop-count + floor-drift assertions on worker clock. |
| src/parser/parser_impl.cpp | Migrate architecture pointers from sec.N to #anchor. |
| src/misc/job_que.cpp | Migrate architecture pointers from sec.N to #anchor. |
| src/misc/ARCHITECTURE.md | Add {#anchor} to the cited section heading (spin window). |
| src/builtin/REVIEW.md | Update review rule text to describe #anchor pointer style and LINT026 behavior. |
| src/builtin/module_builtin_rtti.cpp | Migrate pointer comment to #anchor. |
| src/builtin/module_builtin_fio.cpp | Migrate pointer comments to #anchor. |
| src/builtin/module_builtin_debugger.cpp | Migrate pointer comment to #anchor. |
| src/builtin/module_builtin_dasbind.cpp | Migrate pointer comments to #anchor. |
| src/builtin/module_builtin_ast.cpp | Migrate pointer comments to #anchor. |
| src/builtin/module_builtin_ast_serialize.cpp | Migrate pointer comments to #anchor. |
| src/builtin/ARCHITECTURE.md | Add {#anchor} suffixes to headings cited from C++ and tools. |
| src/ast/dyn_modules.cpp | Migrate pointer comments to #anchor. |
| src/ast/ast_simulate.cpp | Migrate pointer comments to #anchor. |
| src/ast/ast_parse.cpp | Migrate pointer comments to #anchor. |
| src/ast/ast_module.cpp | Migrate pointer comments to #anchor. |
| src/ast/ARCHITECTURE.md | Add {#anchor} suffixes to headings used by migrated citations. |
| skills/mcp_tools.md | Update documentation of arch_of/arch_sites to match new locator output and C/C++ pointers. |
| skills/comment_style_hygiene.md | Update rule text to prefer // <doc>#<anchor> pointers over sec.N for C++. |
| REVIEW_COMMON.md | Extend audit rule to include C++ under // <doc>#<anchor> pointers. |
| modules/dasLLVM/ARCHITECTURE_TARGET_FEATURES.md | Minor wording adjustment around numbered sections and stability. |
| modules/dasImgui/src/module_imgui_app.cpp | Migrate module architecture pointers from sec.N to #anchor. |
| modules/dasGLTF/CMakeLists.txt | Install the glTF asset converter script into the SDK bundle. |
| include/daScript/simulate/aot_builtin_ast.h | Migrate pointer comment to #anchor. |
| include/daScript/ast/dyn_modules.h | Migrate pointer comment to #anchor. |
| include/daScript/ast/ast.h | Migrate pointer comments to #anchor. |
| include/daScript/ast/ast_serializer.h | Migrate pointer comment to #anchor. |
| include/daScript/ast/ast_handle.h | Migrate pointer comment to #anchor. |
| CMakeXxdImpl.txt | Generate .inc with LF consistently via configure_file(... NEWLINE_STYLE LF) to avoid Windows rewrite churn. |
| CMakeLists.txt | Install additional tools; add CONFIGURE_DEPENDS to multiple file(GLOB ...) install lists. |
| CLAUDE.md | Update [arch] guidance to include C++ pointer spelling and locator-based MCP behavior. |
| ci/smoke_test_bundle.sh | Add MESHOPTIMIZER license to bundle smoke license roster. |
| CHANGELIST.md | Record this PR and the prior PR’s changes in the changelist. |
| ARCHITECTURE_COMMON.md | Update the repo-wide architecture-citation contract to include C/C++ pointer citations. |
| .gitattributes | Pin *.das.inc to LF to prevent autocrlf-based churn/accidental commits. |
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c647e2b to
eb58932
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It changes lint semantics/tooling + SDK install behavior across many subsystems, so it needs a final human review pass even though most changes look well-scoped.
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 2
- Review effort level: Lite
eb58932 to
e4f970a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Preflight’s changed-file classification currently omits some real C/C++ source extensions (e.g. .c), which can prevent the intended LINT026 arch-pointer validation from running on those diffs.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 1
- Review effort level: Lite
e4f970a to
bafaf1a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
arch_sites currently de-duplicates cross-root matches by file:line, which can drop distinct citations that share a line (e.g., multiple pointers in one // comment) when scan roots overlap.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 1
- Review effort level: Lite
bafaf1a to
51d7f65
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The C/C++ citation scanner’s suffix allowlist omits .inc, so LINT026 and the MCP arch tools can silently miss // <doc>.md#<anchor> pointers placed in .inc include files.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 1
- Review effort level: Lite
51d7f65 to
31855e4
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It changes multiple enforcement/tooling layers (lint, MCP tools, preflight, install rules, tests) across many subsystems, so it warrants a final human pass despite only a small concrete issue found.
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 1
- Review effort level: Lite
31855e4 to
88a8001
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The changes are cross-cutting (lint semantics, MCP tools, tests, CMake install behavior, and widespread C/C++ doc pointers), so they warrant final human review despite only minor actionable nits.
Review details
- Files reviewed: 45/45 changed files
- Comments generated: 1
- Review effort level: Lite
…s it, the arch tools locate instead of quote, the worker heap test measures collection, and the install lists catch up
A C or C++ source cites an architecture section the way a .das declaration does now. The
spelling is `// <doc>#<anchor>` inside a `//` comment - the kept-set pointer the comment rulebook
already named, with the anchor in place of `sec.N`, a number nothing could check. One scanner
(utils/common/arch_citations.das) reads both spellings: a .das file for its [arch(at=...)]
annotations, a C++ file for its pointers, whose path is root-relative and whose root is the first
folder up from the citing file the path exists under, so a header in include/ reaches the src/
document that owns its mechanism and a planted fixture tree resolves inside itself; the
folder-tree rule does not bind C++ for the same reason. A URL to a document on the web is not a
pointer - a scheme's walk-back leaves a leading slash, a bare host a dotted first segment - which
imgui's vendored sources proved on the first run. LINT026 walks C++ in both directions, and
preflight's lint gate hands changed .cpp and headers to it; arch-extract reads the pointers, so a
section cited only from C++ lands in the SDK excerpt (src/misc sec.8 has no other citer); the
sixty-one `sec.N` pointers are rewritten to anchors and the eleven sections they name carry
`{#anchor}` headings. The fixture plants a C++ source with a resolving pointer, a dangling one,
an #include, a block comment and two URLs, a header under include/deep reaching src/ through the
root above both, and a negative control that swaps the anchor away and back.
`arch_of` and `arch_sites` answered a question nobody asked: eight calls in their whole life,
against thousands for lint and compile_check, because `arch_of` dumped the section's text and
lost the coordinates the next step - a Read or an Edit of that section - needs, while
`arch_sites` was a grep. `arch_of` is a locator now, one line per citation,
`<file>:<line> <symbol> -> <doc>:<first>-<last> #<anchor>`, both spellings; `arch_sites` gives
each anchor its section's line range and reads the C++ homes (src/, include/, every module's
src/) beyond the document's own subtree, since a C++ citer may sit anywhere in them - the census
of src/ast's manifest section grew from 11 sites to 22 in 10 files. CLAUDE.md sends a reader to
the document first and to the tools for where.
tests/strudel_device/test_worker_heap.das flaked at 10242 KB against a 10 MB bar, on darwin
Debug. The number the strudel worker publishes is its heap BEFORE the tick's collect, so it reads
live set plus that tick's garbage, and a tick's garbage runs from hundreds of kilobytes to ten
megabytes: on an idle 64-core box the published number spans 9.7 MB while its floor moves 0 KB.
`peak - base` measured the burstiness of a pattern query, not collection, and the bar was widened
2 -> 5 -> 10 MB in one day chasing it. The test now asserts the two things only a collect
produces - a published number lower than the one before it (28 per six worker-seconds here; zero
without collection, which test_worker_no_gc.das pins) and a floor that holds across two stretches
(uncollected grows ~10 MB a stretch) - with warm-up and the stretches on the worker's own clock,
so a slow box warms up before it is measured.
The install lists: modules/dasGLTF/tools/convert.das, the asset converter the README documents,
and utils/aot/main_llvm_aot.das, the LLVM object AOT driver, ship; the twelve utils/* install
GLOBs carry CONFIGURE_DEPENDS, so a file added after a box's last configure lands in its bundle;
MESHOPTIMIZER.LICENSE joins the bundle smoke's roster (the module is default-on and its notice
installed, and the gate that exists to notice a silently skipped install rule did not list it).
CMake's file(WRITE) emits the platform newline, so on Windows the xxd step rewrote every tracked
.das.inc with CRLF on every build - its "not modified, skipped" branch could never fire there -
and `git add -A` swept two of them into the last PR twice; the step pins LF through
configure_file, and .gitattributes pins *.das.inc so a checkout cannot flip it back.
CHANGELIST.md carries this and the previous PR.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
88a8001 to
ffdfe7b
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
It touches cross-cutting correctness gates (lint + MCP tooling + build/install + tests) across many subsystems, so it warrants a final human review despite no specific defects found in this pass.
Review details
- Files reviewed: 45/45 changed files
- Comments generated: 0 new
- Review effort level: Lite
Behavior changes: C and C++ cite architecture sections by anchor and LINT026 checks them; the MCP
archtools return locations instead of text; the strudel worker-heap test measures collection; four install and gate rosters catch up with the tree.Why. The pre-release sweep before 0.6.4. C++ cited architecture documents by section number -
// src/ast/ARCHITECTURE.md sec.2- a spelling nothing could validate and a renumber silently orphaned. The MCParch_of/arch_sitestools had eight calls in their whole life: they returned a section's text and lost the coordinates the next step needs.test_worker_heap.dasflaked at 10242 KB against a 10 MB bar because it measured the wrong quantity. And a converter, a driver, a license and twelve install GLOBs were missing from the SDK's rules.What changes.
// <doc>#<anchor>pointer in a C/C++//comment is the C++ spelling of the[arch]citation. One scanner (utils/common/arch_citations.das) reads both; the path is root-relative, the root found by walking up from the citing file, so a header underinclude/reachessrc/'s document, and the folder-tree rule does not bind C++. LINT026 walks C++ both ways; preflight's lint gate hands changed C++ to it;arch-extractreads the pointers so a C++-only-cited section reaches the SDK excerpt. 61sec.Npointers migrated; 11 headings anchored. A web URL ending in.md#xis not a pointer.arch_ofis a locator:file:line symbol -> doc:first-last #anchor, one line per citation, both spellings.arch_sitesgives every anchor its section's line range and searches the C++ homes beyond the document's subtree.test_worker_heap.dasasserts what only a collect produces - the published heap drops between ticks, and its floor holds across two stretches - on the worker's own clock.modules/dasGLTF/tools/convert.dasandutils/aot/main_llvm_aot.dasinstall; theutils/*install GLOBs carryCONFIGURE_DEPENDS;MESHOPTIMIZERjoins the bundle smoke's license roster..das.incwith LF (CMake'sfile(WRITE)emits CRLF on Windows, so its skip-if-unchanged branch never fired there and every build rewrote every.inc);.gitattributespins*.das.incto LF.CHANGELIST.mdcarries this PR and the previous one (the browser's K-quant dot rides the idot lattice, wasm gets its FMA, and neither the spin window nor the audio mixer pays the host clock #4045).Observable behavior.
// src/misc/ARCHITECTURE.md#spin-window-clock-stridethat names a missing document or anchor is a LINT026 finding at its line; an anchor cited only from C++ is no longer "uncited".arch_of src/misc/job_que.cppprintssrc/misc/job_que.cpp:41 -> src/misc/ARCHITECTURE.md:113-142 #spin-window-clock-stride.arch_sites src/ast/ARCHITECTURE.md#module-scan-manifestlists 22 sites in 10 files acrosssrc/ast,src/builtin,src/parserandinclude/..das.incfiles;git statusstays clean after a build.utils/*file added since the last configure.Where to look. The scanner is
utils/common/arch_citations.das(collect_arch_pointers); the lint pass isrun_arch_passinutils/lint/main.das; the tools areutils/mcp/tools/arch_of.dasandarch_sites.das; the test istests/strudel_device/test_worker_heap.das; the rule text isskills/comment_style_hygiene.md,ARCHITECTURE_COMMON.md,REVIEW_COMMON.md.Validation, claims, ledger
Validation
utils/lint/tests/lint026_arch_citations.das: 24 tests, 24 passed. The newtest_arch_cpp_pointersplants a C++ source with a resolving pointer, a dangling one (named at its line), an#include, a block comment and two URLs (none fire), a header underinclude/deepreachingsrc/ARCHITECTURE.mdthrough the root above both, and a negative control that swaps the anchor away (the pointer fires, the anchor is owed) and back (silent).tests/strudel_device/test_worker_heap.das: 2 tests, 2 passed, 11.9 s. Behind the bars: three runs on this box, byte-identical - 28 drops per six worker-seconds, floor drift 0 KB, published span 9735 KB.--only format,lint,review-md: 3 passed. Lint covers 39 changed files on both rails, which is LINT026 over the real tree with C++ read: every one of the 61 migrated pointers resolves and every one of the 11 new anchors is cited. First run of the gate caught two things this PR then fixed: vendored imgui's GitHub URLs read as pointers (the URL rule), andutils/REVIEW.dasrefusing a comment that spelledutils/internal/in a shipped tool.arch-extract --base src src include: 3 documents, 11 sections, 58 citations from 310 files;src/misc's sec.8 (cited only from C++) andsrc/ast's sec.4 (cited frominclude/daScript/ast/ast.h) both land in the excerpt.-compile-only):utils/lint/main.das,utils/mcp/main.das,utils/internal/arch-extract/main.das,utils/internal/preflight/main.das.modules/dasUnitTest/unit_test.das: "has not been modified. C-array generation is skipped." - the branch that never fired on Windows - and the tracked.incis byte-identical to git.cmake -Pon a two-linefile(WRITE "a\nb\n")writesa\r\nb\r\non this box, which is the defect.ci/check_shipped_skills.pyover the checkout: no finding inskills/mcp_tools.mdorskills/comment_style_hygiene.md.mcp_server.log, 7233tools/callsince 2026-05-28 -arch_of1,arch_sites7, both inside one 8-day window in this worktree;lint1598,compile_check1525,format_file1055.commofgit diff --name-onlywith and without--ignore-cr-at-eolis empty.Claims - stated, not tested
CONFIGURE_DEPENDSchange is asserted from CMake's documented GLOB semantics, not from a before/after install on a stale configure.MESHOPTIMIZER.LICENSEreaching the bundle root is asserted from the module's existing install rule plus the roster line; the bundle smoke itself runs in CI (bundle_smoke), not here.test_worker_heap.das's bars (MIN_DROPS = 6,FLOOR_DRIFT_LIMIT = 4 MB) are set from this box's numbers with 5x and 2.5x margins; the darwin Debug runner that flaked the old test has not run the new one yet - CI will.Not done
//!reader change (an above-def//!attaching to the def, astypedefalready does): 3828 functions' only docstring sits in the position the reader drops, andfio.das'smatch_globreads "to be documented" in the generated reference with its//!right above it. A regen-sized sweep, kept out of this PR.arch_sitesstill walks the.dascensus from the document's own subtree only; the C++ homes are added on top. A.dasciter outside the subtree is a LINT026 finding by rule, so the census is complete for a lint-clean tree.utils/benchctl/tests/remains red on Windows (bin/daslangspelled whereget_host_binary()is, andspawn_processthrowing on a failedCreateProcesswhere POSIX reports through the exit code) - a builtin-contract ruling, noted in the browser's K-quant dot rides the idot lattice, wasm gets its FMA, and neither the spin window nor the audio mixer pays the host clock #4045.