Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ tree-sitter-daslang/src/*.c text eol=lf
tree-sitter-daslang/src/*.json text eol=lf
tree-sitter-daslang/src/tree_sitter/*.h text eol=lf

# The xxd step (CMakeXxdImpl.txt) regenerates a tracked .das.inc beside its source on every
# build; the generator writes LF, and this keeps a checkout under autocrlf=true from reading
# every line as changed and `git add -A` from committing a line-ending flip.
*.das.inc text eol=lf

# The v1 -> gen2 converter preserves whatever line endings its input had, and
# its suite proves that by converting an LF fixture and a CRLF twin it builds
# from that same fixture. Under autocrlf=true the fixtures check out as CRLF,
Expand Down
9 changes: 6 additions & 3 deletions ARCHITECTURE_COMMON.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ and the exception ledger. Nothing else.**
for different content: append new sections, never renumber.

**A section that code implements carries a `{#anchor}` on its heading, and every anchor is
cited by an `[arch(at="<doc>#<anchor>")]` on a function in the document's own folder tree.**
One anchor per heading; the anchor name is stable across rewording, like the section number.
An anchor no function cites, a citation naming no anchor, and a citation reaching a document
cited by an `[arch(at="<doc>#<anchor>")]` on a function in the document's own folder tree, or
by a `// <doc>#<anchor>` pointer in a C or C++ source.** One anchor per heading; the anchor
name is stable across rewording, like the section number. A C++ pointer's path is root-relative
(`src/ast/ARCHITECTURE.md#...`), found by walking up from the citing file, and the folder-tree
rule does not bind it - a header under `include/` answers for a mechanism `src/` documents.
An anchor no code cites, a citation naming no anchor, and a `.das` citation reaching a document
outside the citer's folder tree are all lint findings (LINT026), in every folder. A mechanism
another folder's document states is restated here in prose - a paragraph, not a resolved link -
and the code cites this document. A section no function implements is narrative and carries no
Expand Down
6 changes: 6 additions & 0 deletions CHANGELIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ A native glTF 2.0 loader with an OpenGL PBR renderer, viewer, and capstone tutor
- **Real threads on the web** (#3293, #3309, #3331) - `DAS_WASM_PTHREADS` with an AudioWorklet audio thread, real core count via `emscripten_num_logical_cores`, and the worklet futex + persistent-jobque fixes
- **Pure-das Dear ImGui renderer** (#3283) and its compile-time WebGL2 draw path + `get_running_platform_name` (#3294); strudel audio in the playground (#3272); embedded fonts (#3292); canvas-CSS-size/DPR + `glfw_toggle_fullscreen` externs for responsive, fullscreen-capable cards (#3323, #3326)
- **Static-link gates** (#3351, #3358) - `examples/fatman` links every external C++ module into one host with a CI lane (the ABI canary for daslang-vs-externals drift), and its web sibling builds the imgui family from source into the threaded wasm playground
- **The browser tier's K-quant dot, FMA, spinning workers, and a mixer off the host clock** (#4045) - `dot_k4q8` rides the `idot` lattice op (both nibbles into a signed `byte16`, one body, no target branch; 1.1x -> 1.7x real time for Pocket TTS on the parrot page, 1.90x on x64, bit-exact), `+relaxed-simd` joins the wasm feature string so a contracted multiply-add becomes `f32x4.relaxed_madd` instead of splitting (8728 contractions across the module), the job queue's spin window reads the clock once per stride and pauses with no JS in it (pool clock time 25 s -> 5 s per 15 s window), and a browser's workers take the same 30 ms spin window as every other target (1.7x -> 2.3x); dasAudio's browser mixer parks on a drain counter the worklet bumps instead of a sleep, primes a 20 ms ring before the device starts, and counts underruns (`sound_playback_underrun_frames`)

#### dasTerminal: Terminal Emulator in daslang (#3510, #3513, #3514, #3516)

Expand Down Expand Up @@ -264,6 +265,7 @@ Z3 SMT solver bindings as a dynamic module, dasLLVM-style.
- **`daslib/build_const` + `[EnvConfig]`** (#3643, #3701) - compile-time constants that fold pre-infer, feed `static_if`, and land in the semantic hash; clargs environment-variable twins; and the shared `daslib/env_registry` knob rail (dasLLAMA's 146 env vars in eleven structs, drift-tested docs)
- **Review rails** (#3711, #3723, #3743, #3750) - folder-scoped `REVIEW.md` checklists under one shared contract with tool-driven discovery, the constitutional branch-test rule with a per-PR TDD audit, and review-comment triage + `pr-babysit` watch tooling
- **MCP stability** (#3729) - the `run_with_progress` channel-scope race fixed (`join()` is the fence)
- **The pre-release sweep** (#4047) - `modules/dasGLTF/tools/convert.das` (the asset converter its README documents) and `utils/aot/main_llvm_aot.das` (the LLVM object AOT driver) install with the SDK; the twelve `utils/*` install GLOBs carry `CONFIGURE_DEPENDS`, so a file added after a box's last configure lands in its bundle; the xxd step writes its tracked `.das.inc` with LF (CMake's `file(WRITE)` emits CRLF on Windows, so the "unchanged, skipped" branch never fired there and every build rewrote every `.inc`), with `.gitattributes` pinning `*.das.inc` to LF; MCP `arch_of` becomes a locator (`file:line symbol -> doc:first-last #anchor`, one line per citation, no text dump) and `arch_sites` carries each anchor's line range - the shape a Read or Edit of the section follows from

#### Lint

Expand All @@ -278,6 +280,7 @@ Z3 SMT solver bindings as a dynamic module, dasLLVM-style.
- **The out-param and sizing wave** (#3783) - LINT023 a by-value `var` parameter written but never read (the error message that never reaches its caller), LINT024 a 32-bit product with a call among the factors wrapped in a 64-bit cast, and PERF032 `@exact_size`: on an annotated array every grow must follow a `reserve` of the same receiver - the input-sized-buffer panic class, annotated across dasLLAMA; the whole-tree sweep is clean on both the Linux and macOS module renderings, and it surfaced two compiler fixes (a location-less `delete super.self` cast, `for_each_pass_macro` skipping three macro lists)
- **The full sweep + the nightly lane** (#3733, #3741) - the whole tree lints to zero: ~3900 findings retired across 841 files (net -290 lines), three rules corrected rather than obeyed, and a nightly whole-tree lint lane that promptly reaped ten stale nolints
- **Lint prints the offending source line** under each warning (#3585)
- **LINT026 reads C and C++** (#4047) - a `// <doc>#<anchor>` pointer inside a `//` comment is the C++ spelling of the `[arch]` citation, resolved by the shared scanner exactly as a `.das` annotation (the path root-relative, walked up from the citing file, so a header under `include/` reaches `src/`'s document; the folder-tree rule does not bind C++), checked both ways by lint, read by `arch-extract` for the SDK excerpt and by the MCP `arch` tools; preflight's lint gate hands changed C++ files to the pass. The 61 `// <doc> sec.N` pointers - a number nothing could check - are migrated to anchors, and the eleven sections they name carry `{#anchor}` headings

### Bug Fixes

Expand All @@ -299,6 +302,8 @@ Z3 SMT solver bindings as a dynamic module, dasLLVM-style.
- **Nine red-first fixes from the doc-probe triage** (#3662) - `operator []<-` dispatch, `require X as Y` alias registration for all forms, false `[nodiscard]` errors in string interpolation, the `each_ref` crash, transactional qmatch captures, linq `_fold` defer, SQL generated-column visibility, and the temp-string AOT hash desync (162 `error[50101]` -> 0)
- **`float2(x) * y` folded to `(x*y, 0)`** (#3776) - the splat-collapse rule installed a scalar operator under a vector-typed node, and its operand swap could reorder observable effects; both arms now require the other operand to be the vector and decline impure operands - one AST-level fix covers interpreter, JIT, and AOT (v0.6.4-RC1 only)
- **The RC1 `-exe` toolchain could not run from a bundle** (#3779, #3781) - the prebuilt tools' rpath missed the installed `lib/` on Linux/macOS; the module native-path table carried the build machine's absolute paths, now re-rooted at run time (exe-relative, then das-root, then baked); and `dastest.exe` demanded a JIT it does not link - it runs the interpreter, the `-jit` host is unchanged. The bundle smoke now launches every shipped tool instead of presence-checking it
- **Browser audio corrupted on Windows** (#4045) - the mixer's producer slept 1 ms when its 10.7 ms ring was full, and a sleep resolves to the host's timer quantum: ~1 ms on macOS, 15.6 ms on Windows (measured in a Worker at 16.0 ms median, 16.6 ms worst), so the ring emptied every cycle there while the same build played clean on a Mac. It parks on a drain counter now; `modules/dasAudio/REVIEW.md` bans a sleep-timed producer and a ring deepened to hide underruns. In the same change a zero spin window parked one iteration late after a served team chunk, and `standalone_capi_dasbind` could never pass under a multi-config generator (the fixture DLL landed in `Release/` while the generated bindings looked one level up)
- **`test_worker_heap.das` flaked at 10.002 MB against a 10 MB bar** (#4047) - the number the strudel worker publishes is its heap BEFORE the tick's collect, so it jitters by one tick's garbage (up to ~10 MB on a cycle-boundary tick, 9.7 MB of spread on an idle 64-core box) and a `peak - base` bar measured that burstiness, not collection - widened 2 -> 5 -> 10 MB chasing it. The test now asserts what only a collect produces - a published number lower than the one before it, and a floor that holds across two stretches - on the worker's own clock

### Site / Blog / Docs

Expand All @@ -324,6 +329,7 @@ Z3 SMT solver bindings as a dynamic module, dasLLVM-style.
- **The release audit** (#3773, #3782) - `utils/internal/test-release`: the compile phase proves every shipped example and tutorial against the bundle's own binary (803 targets), and the utils phase exercises every shipped tool from the extracted bundle alone (exit code plus output only a working run prints). The RC1 sweep's structural yield: `examples/` and `tutorials/` install as whole directories, so 31 silently-dropped files ship again; three ship-defects fixed; package examples moved to their package repos
- **A hung sweep names the program that hung** (#3949) - dastest prints a timestamped `run N/M: <file>` before every program of a sequential sweep and `worker K starts: <files>` before every isolated batch, on stderr, flushed at once and printed under `--failures-only` too; the `run_tests_*` cmake targets carry `USES_TERMINAL`, so Ninja streams the sweep's output instead of holding it until the command ends - a lane cancelled mid-hang keeps its last line instead of losing everything the sweep printed. The first hang those lines named was `tests/debug_agent/test_callback_threadlock.das`: its hook waited on a thread that had yet to create its context, while the tick holds the agent registry every context creation needs - `DapiDebugAgent` carries the contract, and the test now proves the callback/pinvoke serialization from one thread with the new `try_invoke_in_context`, the non-blocking `invoke_in_context` that returns false, running nothing, while another thread holds the context lock
- **Bounded apt on ubuntu runners** (#3785) - every workflow apt site goes through `ci/apt_install.sh`: the degrading Azure mirror swapped for the public archive (mirrorlist included), capped fetches, retried update - the worst case becomes a loud failure in minutes instead of a silent hours-long hang
- **Gate rosters catch up with the tree** (#4047) - `MESHOPTIMIZER.LICENSE` joins the bundle smoke's license roster (the module is default-on and its MIT notice installed, but the gate that exists to notice a silently-skipped install rule did not list it); preflight's compile sweep stops trying `examples/dasLLAMA/library/main.das`, whose `dasllama_lib_c` only the opt-in `dasllama_lib_jit` target writes (#4045); `tests-cpp`'s `standalone_ctx` fixture pins its output directory with `$<1:...>` so `standalone_capi_dasbind` passes under Visual Studio and Xcode generators (#4045)

### Examples and Tutorials

Expand Down
10 changes: 6 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ beside the tree's install rules) so LINT026 stays armed in an installed SDK.
The mood test routes misplaced text: must/never binding a diff -> REVIEW.md; present-tense
fact -> ARCHITECTURE.md; dated or past-tense -> deleted, git keeps it.

**Before editing a function annotated `[arch(at="<doc>.md#<anchor>")]`, read the section it
cites.** MCP `arch_of` returns each of a file's citations with its section text; `arch_sites`
returns a document's anchors with the code citing them, dead anchors and dangling citations
included. Citation spelling, path resolution, and failure reasons: `skills/mcp_tools.md`.
**Before editing a function annotated `[arch(at="<doc>.md#<anchor>")]`, or C++ under a
`// <doc>.md#<anchor>` pointer, read the section it cites** - open the document at the anchor.
MCP `arch_of` locates every citation a file makes (`file:line symbol -> doc:first-last #anchor`,
both spellings) and `arch_sites` lists a document's anchors with their line ranges and citers,
dead anchors and dangling citations included. Citation spelling, path resolution, and failure
reasons: `skills/mcp_tools.md`.

**An architecture-doc heading that code cites carries the `{#anchor}` its citation names, and
every anchor is cited.** LINT026 fails a citation naming no such file or anchor, and - in every
Expand Down
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,9 @@ install(FILES ${PROJECT_SOURCE_DIR}/src/misc/LUAU.LICENSE DESTINATION ${DAS_INST
# (machine-checked by utils/REVIEW.das).

# Install aot tool (the AOT generation driver the integration scaffolds invoke)
install(FILES ${PROJECT_SOURCE_DIR}/utils/aot/main.das DESTINATION utils/aot)
install(FILES ${PROJECT_SOURCE_DIR}/utils/aot/main.das
${PROJECT_SOURCE_DIR}/utils/aot/main_llvm_aot.das
DESTINATION utils/aot)

# Install fix-lint-errors tool (mechanical lint auto-fixer)
install(FILES ${PROJECT_SOURCE_DIR}/utils/fix-lint-errors/main.das DESTINATION utils/fix-lint-errors)
Expand Down Expand Up @@ -2006,9 +2008,9 @@ install(FILES
${PROJECT_SOURCE_DIR}/utils/mcp/README.md
DESTINATION utils/mcp
)
file(GLOB DAS_MCP_TOOLS ${PROJECT_SOURCE_DIR}/utils/mcp/tools/*.das)
file(GLOB DAS_MCP_TOOLS CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/mcp/tools/*.das)
install(FILES ${DAS_MCP_TOOLS} DESTINATION utils/mcp/tools)
file(GLOB DAS_MCP_SUBTOOLS ${PROJECT_SOURCE_DIR}/utils/mcp/subtools/*.das)
file(GLOB DAS_MCP_SUBTOOLS CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/mcp/subtools/*.das)
install(FILES ${DAS_MCP_SUBTOOLS} DESTINATION utils/mcp/subtools)
install(FILES
${PROJECT_SOURCE_DIR}/utils/mcp/test_tools.das
Expand Down Expand Up @@ -2037,7 +2039,7 @@ install(FILES
${PROJECT_SOURCE_DIR}/utils/lsp/README.md
DESTINATION utils/lsp
)
file(GLOB DAS_LSP_SUBTOOLS ${PROJECT_SOURCE_DIR}/utils/lsp/subtools/*.das)
file(GLOB DAS_LSP_SUBTOOLS CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/lsp/subtools/*.das)
install(FILES ${DAS_LSP_SUBTOOLS} DESTINATION utils/lsp/subtools)
install(FILES ${PROJECT_SOURCE_DIR}/utils/lsp/plugin/.claude-plugin/plugin.json
DESTINATION utils/lsp/plugin/.claude-plugin
Expand Down Expand Up @@ -2068,11 +2070,11 @@ install(FILES
# Install dascov (code coverage)
install(FILES ${PROJECT_SOURCE_DIR}/utils/dascov/main.das DESTINATION utils/dascov)
install(FILES ${PROJECT_SOURCE_DIR}/utils/dascov/README.md DESTINATION utils/dascov)
file(GLOB DAS_DASCOV_TEST_FILES ${PROJECT_SOURCE_DIR}/utils/dascov/tests/*.das)
file(GLOB DAS_DASCOV_TEST_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/dascov/tests/*.das)
install(FILES ${DAS_DASCOV_TEST_FILES} DESTINATION utils/dascov/tests)

# Install benchctl (benchmark analysis)
file(GLOB DAS_BENCHCTL_FILES ${PROJECT_SOURCE_DIR}/utils/benchctl/*.das)
file(GLOB DAS_BENCHCTL_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/benchctl/*.das)
install(FILES ${DAS_BENCHCTL_FILES} DESTINATION utils/benchctl)
install(FILES ${PROJECT_SOURCE_DIR}/utils/benchctl/README.md DESTINATION utils/benchctl)
install(FILES ${PROJECT_SOURCE_DIR}/utils/benchctl/suite.json DESTINATION utils/benchctl)
Expand All @@ -2086,7 +2088,7 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/lint/tests/
)

# Install detect-dupe (cross-file duplicate-function detector)
file(GLOB DAS_DETECT_DUPE_FILES ${PROJECT_SOURCE_DIR}/utils/detect-dupe/*.das)
file(GLOB DAS_DETECT_DUPE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/detect-dupe/*.das)
install(FILES ${DAS_DETECT_DUPE_FILES} DESTINATION utils/detect-dupe)
install(FILES
${PROJECT_SOURCE_DIR}/utils/detect-dupe/README.md
Expand All @@ -2100,7 +2102,7 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/detect-dupe/fixture/
# Install find-dupe (AI judge for detect-dupe clusters via das-claude).
# Not built into all_utils_exe — it depends on the das-claude daspkg
# package fetched at runtime, which isn't available at build time.
file(GLOB DAS_FIND_DUPE_FILES ${PROJECT_SOURCE_DIR}/utils/find-dupe/*.das)
file(GLOB DAS_FIND_DUPE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/find-dupe/*.das)
install(FILES ${DAS_FIND_DUPE_FILES} DESTINATION utils/find-dupe)
install(FILES
${PROJECT_SOURCE_DIR}/utils/find-dupe/README.md
Expand All @@ -2116,15 +2118,15 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/find-dupe/tests/
# server startable: it runs interpreted with no -project, and its require graph reaches
# utils/common/arch_citations.das (via utils/mcp/tools/arch_common) and
# utils/common/git_signature.das (via utils/mcp/tools/cpp_common).
file(GLOB DAS_UTILS_COMMON_FILES ${PROJECT_SOURCE_DIR}/utils/common/*.das)
file(GLOB DAS_UTILS_COMMON_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/common/*.das)
install(FILES ${DAS_UTILS_COMMON_FILES} DESTINATION utils/common)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/common/tests/
DESTINATION utils/common/tests
FILES_MATCHING PATTERN "*.das"
)

# Install daspkg (package manager)
file(GLOB DAS_DASPKG_FILES ${PROJECT_SOURCE_DIR}/utils/daspkg/*.das)
file(GLOB DAS_DASPKG_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/daspkg/*.das)
install(FILES ${DAS_DASPKG_FILES} DESTINATION utils/daspkg)
install(FILES
${PROJECT_SOURCE_DIR}/utils/daspkg/README.md
Expand All @@ -2136,7 +2138,7 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/utils/daspkg/fixtures/
)

# Install das-fmt (daslang formatter)
file(GLOB DAS_FMT_FILES ${PROJECT_SOURCE_DIR}/utils/das-fmt/*.das)
file(GLOB DAS_FMT_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/das-fmt/*.das)
install(FILES ${DAS_FMT_FILES} DESTINATION utils/das-fmt)
install(FILES
${PROJECT_SOURCE_DIR}/utils/das-fmt/README.md
Expand All @@ -2147,7 +2149,7 @@ install(FILES

# Install dasllama-server (OpenAI-compatible LLM server; JIT-only, runs from the
# SDK's live toolchain — see its deploy-jit.ps1 for the standalone bundle path)
file(GLOB DAS_LLAMA_SERVER_FILES ${PROJECT_SOURCE_DIR}/utils/dasllama-server/*.das)
file(GLOB DAS_LLAMA_SERVER_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/dasllama-server/*.das)
list(FILTER DAS_LLAMA_SERVER_FILES EXCLUDE REGEX "/REVIEW\\.das$")
install(FILES ${DAS_LLAMA_SERVER_FILES}
${PROJECT_SOURCE_DIR}/utils/dasllama-server/README.md
Expand Down Expand Up @@ -2175,7 +2177,7 @@ install(FILES
)

# Install jobque-timeline (per-lane jobque trace viewer)
file(GLOB DAS_JOBQUE_TIMELINE_FILES ${PROJECT_SOURCE_DIR}/utils/jobque-timeline/*.das)
file(GLOB DAS_JOBQUE_TIMELINE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/utils/jobque-timeline/*.das)
install(FILES ${DAS_JOBQUE_TIMELINE_FILES}
${PROJECT_SOURCE_DIR}/utils/jobque-timeline/README.md
DESTINATION utils/jobque-timeline
Expand Down
Loading
Loading