Skip to content

dasLLAMA portable tier: the tune framework optional, AOT and wasm64 builds, the storyteller in the browser - #3948

Merged
borisbat merged 43 commits into
masterfrom
bbatkin/dasllama-portable-tier
Sep 6, 2026
Merged

dasLLAMA portable tier: the tune framework optional, AOT and wasm64 builds, the storyteller in the browser#3948
borisbat merged 43 commits into
masterfrom
bbatkin/dasllama-portable-tier

Conversation

@borisbat

@borisbat borisbat commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Behavior change: require llvm/daslib/{f16_cvt,aarch64_neon,x64_avx} moved to daslib/, the [tune] annotations come from daslib/tune, and every TTS .dlim re-bakes once - external code requiring the old paths must update its requires.

Why. dasLLAMA needs LLVM for exactly one file, the IR generator behind the tuned kernels, yet a build configured without dasLLVM could not load the module (error[20605] missing prerequisite 'llvm/daslib/f16_cvt'), so no AOT build and no browser build existed.

What changes.

  • dasLLVM carries a C++ witness module llvm, compiled only when the build is configured with dasLLVM; require ?llvm reads the build configuration, never the files on disk.
  • f16_cvt, aarch64_neon, x64_avx and the inert [tune]/[tuned]/[tune_scope] shells move to daslib/; the framework stays in dasLLVM and is a no-op without it; DAS_TUNE_POLICY=reference (run.das --no-tune) runs the reference bodies.
  • Six synthetic CPU-oracle units gate the reference bodies (elementwise, activations, rope, CPU prefill, the q8q8 family, the ASR tower kernels).
  • dasllama_aot builds the engine through AOT C++; daspkg release wasm builds a dasLLAMA app for wasm64, and the JIT lowers the int8 dot on wasm to the ISA's exact extmul + pairwise-add form (idot_wasm_simd128, codegen version 0x70); get_target_triple / get_target_architecture_name fold at compile time, from the command line's --jit-target (the last one wins; options jit_target alone is refused).
  • A TTS image serves without its gguf: the family's driver data rides the image meta, load_tts_model takes a .dlim, and dasllama-convert bakes TTS sources and bakes against a foreign identity (--config).
  • tts_g2p_en_us.bin, the American-English phoneme pack (10.3 MB), joins the TTS set on Hugging Face.
  • The storyteller example: stories15M writes while KittenTTS nano reads, native and in the browser; dasllama.io gets an examples page with its card, the model set is the rolling GitHub release dasllama-web, and both sites carry the news.
  • The jobque fork-context pool is per context: a new_thread body running the engine calls setup_dasllama_jobque() itself.
  • The CI lint step's second pass through an -exe-compiled das-lint is retired (below).

Observable behavior.

  • build with DAS_LLVM_DISABLED=ON -> dasLLAMA loads and serves on the portable tier (was: missing prerequisite).
  • require llvm/daslib/f16_cvt -> require daslib/f16_cvt (same for aarch64_neon, x64_avx); [tune] shells -> daslib/tune.
  • daspkg release wasm --root examples/dasLLAMA/storyteller -> a 26 MB wasm64 app; Chrome or Edge 133+ and Firefox 134+ run it from dasllama.io/examples with a 76 MB model set.
  • a program that reaches the framework only through daslib/tune (dasllama-server, lcpp_bench, the profiling helpers) -> compiles and runs with dasLLVM absent; the bench's tune gate refuses to measure there by name (DASLLAMA_ALLOW_UNTUNED=1 stays the dev escape).
  • KittenTTS nano in Chrome on an M1 Max -> real-time factor 0.4 to about 0.3 with the exact wasm int8 dot (the scratch micro-bench: 4.8 -> 9.1 GMAC/s on one lane; the 0.25 measured on 2026-09-05 rode a relaxed-simd dot that review withdrew - not exact at -128, and +relaxed-simd re-means float min/max/mad).
  • an existing TTS .dlim -> re-bakes once (its meta layout changed; IMAGE_VERSION stays 33, the family fingerprint refuses the old file).
  • dasllama-convert -m kitten-nano.gguf -> a TTS image; --config <json> -> an image for another box's identity.

Where to look. modules/dasLLVM/src/dasLLVM.cpp and its .das_module (the witness), daslib/tune.das (the cut), dasllama_styletts2.das (the TTS image meta), idot_wasm_simd128 in llvm_jit_intrin.das, examples/dasLLAMA/storyteller/, and the dasllama.io stage step in pages.yml.

Validation, claims, ledger

Validation

  • Local, M1 Max: the runner's --changed gate over every area (105 files) green before the review fix batch; after it, the tests the batch reaches (test_bench_records_schema, test_tok_seed, test_program_roots, test_tts_g2p, test_math_activations, test_run_suites, the jit cross-target and wasm-lowering tests, optional_require) and the dasLLVM module suite under -jit (74 of 74) are green. The storyteller ran a story with speech natively and as the wasm64 build in Chrome under the site preview.
  • After the rebase onto the moved master: the lint and review-md gates on the tip, test_openai_server, test_model_catalog, test_run_suites, test_program_roots green.
  • The no-LLVM build (a worktree with modules/dasLLVM removed): 18 of 18 kernel and census units green interpreted; every program root (the four server tools, lcpp_bench, speak, the storyteller, dasllama-convert, run.das, the TTS tutorial) compiles with dasLLVM absent.
  • The two small C++ tests the darwin Debug lane reddened: the JIT emitter pin is re-stamped for the idot and feature-string edits; the C API JIT test passes again once a descriptor path gate this review round tried was withdrawn (a static host never registers the witness, and its JIT still runs through the LLVM library).
  • The CI lint step's second pass through an -exe-compiled das-lint is retired: an exe carries the host's module paths without the modules, so inside it the framework's files resolved with no witness and every <name>_variants() reader failed to compile. The changed set is linted once through daslang; das-lint is still built, and the bundle smoke test still runs the shipped lint.exe on daslib.
  • The model set: every Hugging Face file re-pinned through its revision hash matches the manifest, fetch_models reports the TTS set and the American pack ok (its six pending rows are this laptop's absent large-tier models), and gh release download dasllama-web returns the staged bytes.
  • Two woodpecker rounds: the first drove the fix batch (its P1 was the hard llvm_tune require in the server and the bench); the second, on the fix commit, returned one P2 (the deploy script's "already spliced" check read the whole Caddyfile, not the dasllama.io vhost) - fixed, no test (the script needs caddy validate and systemctl).
  • Not run: Vulkan (no device here); the AOT target and the wasm64 app have no CI lane, so their compile is this box's evidence.

Claims - stated, not tested

  • The wasm int8 dot lowering is exact for every int8 lane (extmul + pairwise adds, no 7-bit operand); the IR-shape test pins the instructions, and a break would show as a token mismatch between the wasm and native decodes of the same prompt. The browser real-time factor above is sized from the micro-bench, not re-measured on this tip.
  • The dasllama_aot CMake target's wasm64 build folds the target gates on the HOST (one generated C++ set serves native and wasm64), so that artifact keeps the template dot; the storyteller ships on the JIT-cross rail, where the fold sees the triple.
  • lcpp_bench's edits are the require guard and the --for-debug-purposes discriminator; no timed body changed, so no board cell was re-minted.
  • The American-only phoneme pack is phoneme-identical to the full pack on the 200-sentence corpus (test_tts_g2p), so the kitten rig was not re-run on it.

Not done

  • The kernel vectorization leg beyond the wasm int8 dot (explicit float4/int4 bodies for the scalar kernels; the storyteller decode profile).
  • An ASR example card; the daslang.io examples page stays as it is.
  • Per-build-dir module archive outputs: native, wasm32 and wasm64 builds all write lib/liblibDasModule*.a, and daspkg build --wasm stages whatever sits there.
  • The Caddy header /examples/* block reaches the box only through sudo dasllama-deploy.sh caddy after merge.
  • A static host that does not register the witness (the small C++ test binary is one) answers ?llvm false while its JIT runs through the LLVM library: the tune shells stay inert there. daslib/just_in_time keeps its direct require for that reason; the guard's home in such hosts is an open design question.
  • The module cache does not key on a guarded require's outcome: a tree whose dasLLVM presence flips between runs serves a record compiled for the other world (-no-module-cache, or purge .jitted_scripts/module_cache/, until the key folds it).
  • Untested: --disable-module dasllvm and a second build directory against a tree that carries the witness .shared_module; an explicit -module-cache path is not keyed on --jit-target; the g2p pack tier is prose, not a version byte; tts_serves_q8() reports the pin, not the file; a British voice on the American-only pack routes its phonemes through that pack.
  • AOT and wasm board cells (portable_tier_plan.md).
  • Three rule-document rulings still open: family types in the StyleTTS2 carrier against REVIEW_TTS.md, the optimizer-flattened versus shipped-build wording in include/daScript/simulate/REVIEW.md, and the loader list and restore-versus-reset in tests/REVIEW.md.

Copilot AI lite review requested due to automatic review settings September 5, 2026 22:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are confirmed documentation defects (incorrect return token and a non-compilable tutorial snippet) that should be fixed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR restructures dasLLAMA’s LLVM/tune dependency so the module can load and run on “portable” builds without dasLLVM, while also enabling an AOT host target and wasm64 browser builds (including the new storyteller example) with target-aware compile-time folding.

Changes:

  • Move tune annotation shells and selected intrinsics helpers into daslib/ and introduce an llvm witness module to make require ?llvm ... reflect build configuration rather than filesystem presence.
  • Add/adjust tests and documentation for module_exists, target-folding (get_target_triple / get_target_architecture_name), wasm idot lowering, and AOT struct emission ordering.
  • Extend daspkg release wasm to support disabling host-only modules during cross-compile and update website/server tooling for /examples/* wasm64 hosting.
File summaries
File Description
web/REVIEW.md Checklist references architecture doc
web/CMakeLists.txt Exclude build residue from embeds
utils/internal/preflight/README.md Update lint gate invocation docs
utils/internal/preflight/config.das Remove exe-rail lint helpers
utils/internal/dasllama-ladder/caddy.snippet Add COOP/COEP for /examples
utils/daspkg/test_daspkg.das Assert wasm-disable/emcc marshalling
utils/daspkg/REVIEW.md Clarify shipped-exe + safety rules
utils/daspkg/package_runner.das Plumb wasm_disabled_modules
utils/daspkg/fixtures/test_release.das_package Add wasm-disable + emcc flag
utils/dasllama-server/wav2txt.das Switch to daslib/tune shells
utils/dasllama-server/txt2wav.das Switch to daslib/tune shells
utils/dasllama-server/test_model_catalog.das Update TTS pack expectations
utils/dasllama-server/REVIEW.md Add optional-module reference rule
utils/dasllama-server/README.md Document exchange policy + no-LLVM
utils/dasllama-server/main.das Guard llvm_tune/exchange on module_exists
utils/dasllama-server/ask.das Switch to daslib/tune shells
utils/daslang/main.cpp Include --jit-target in module-cache key; tune_frozen for -use-aot
tutorials/dasLLAMA/16_text_to_speech.das Print selected phoneme pack
tests/README.md Register new AOT test doc row
tests/metal/test_metal_tensor_ops.das Require moved daslib/f16_cvt
tests/metal/REVIEW.md Narrow leak-assert rule to changed tests
tests/language/optional_require.das Add module_exists visibility coverage
tests/language/optional_require_fixture_private.das Fixture: private require chain
tests/language/optional_require_fixture_hidden.das Fixture: hidden module
tests/jit_tests/wasm_idot_lowering.das New wasm idot IR-shape test
tests/jit_tests/llvm_code.das Require daslib/tune for [llvm_code]
tests/jit_tests/f16_cvt.das Require moved daslib/f16_cvt
tests/jit_tests/exe_host_cpu.das Add baseline intrinsic exe test
tests/jit_tests/_wasm_idot_fixture.das New wasm idot fixture
tests/jit_tests/_exe_baseline_intrin.das New baseline intrinsic fixture
tests/jit_tests/_cross_target_fixture.das New target-fold fixture
tests/dastest/test_preflight_config.das Drop exe-rail lint assertions
tests/daslib/test_tune_shells.das New tune-shells tier-invariance tests
tests/aot/test_struct_order.das New AOT struct topological-order test
tests/aot/CMakeLists.txt Use daslib/f16_cvt in AOT metal set; clarify dasLLAMA AOT stance
tests-cpp/REVIEW.md Clarify skip/pass lane guidance
tests-cpp/REVIEW.das Gate: validate set_source_files_properties paths
src/builtin/REVIEW.md Add cache-key doc-update requirement
src/builtin/ARCHITECTURE.md Document --jit-target in cache key
src/ast/ast_program.cpp Treat function/lambda/block types as non-byvalue deps; improve cycle fallback
src/ast/ast_infer_type.cpp Add typeinfo module_exists trait semantics
skills/tune.md Update to daslib/tune shells + optional framework
skills/internal/writing_cpp_tests.md Document per-source flags + #error trap
skills/internal/llvm_tune_internals.md Document shells/framework split + macro-state rationale
skills/internal/build_and_debug.md Document dasllama_aot AOT tier usage
skills/internal/babysit.md Update pre-push lint command
skills/daspkg.md Document wasm-disable module hook + web shell staging
skills/daslang/references/modules-and-stdlib.md Document module_exists usage with guarded requires
skills/daslang/references/generics.md Add module_exists trait to reference
skills/das_macros.md Document module_exists for guarded targets
site/files/examples.js Update memory64 browser version text
site/_news/2026-09-05-dasllama-in-the-browser.md Add news entry
site-dasllama/test_metadata.py Add examples.html to page list
site-dasllama/sitemap.xml Add examples.html + update lastmod
site-dasllama/serve.py Serve /examples/* from web/output64 + send COOP/COEP
site-dasllama/REVIEW.md Tighten “claim must be true” scope
site-dasllama/README.md Document examples.html + local serving
site-dasllama/feed.xml Add storyteller browser entry
site-dasllama/build_news.py Include examples.html in sitemap
site-dasllama/_news/2026-09-05-storyteller-in-the-browser.md Add news entry
modules/dasSpirv/spirv/spirv_builder.das Update f16 conversion commentary
modules/dasLLVM/tests/llvm_tune.das Ensure daslib/tune required in tests
modules/dasLLVM/tests/llvm_tune_scope_early.das Re-export daslib/tune for scope tests
modules/dasLLVM/tests/llvm_tune_scope_client.das Require daslib/tune
modules/dasLLVM/tests/llvm_tune_scope_client_verlib2.das Re-export daslib/tune for version tests
modules/dasLLVM/tests/llvm_tune_scope_client_verlib.das Re-export daslib/tune for version tests
modules/dasLLVM/tests/llvm_tune_scope_client_ver.das Require daslib/tune
modules/dasLLVM/tests/llvm_tune_scope_client_resolver.das Require daslib/tune
modules/dasLLVM/tests/llvm_tune_scope_client_lib2.das Re-export daslib/tune for client libs
modules/dasLLVM/tests/llvm_tune_scope_client_lib.das Re-export daslib/tune for client libs
modules/dasLLVM/tests/llvm_tune_profiles_lib.das Re-export daslib/tune for profile libs
modules/dasLLVM/tests/llvm_tune_modes_client.das Guard variants printing on module_exists(llvm_tune)
modules/dasLLVM/tests/llvm_tune_manifest_client.das Require daslib/tune
modules/dasLLVM/tests/cant_tune_scope_after_covered.das Require daslib/tune
modules/dasLLVM/tests/cant_tune_bad_scope.das Require daslib/tune
modules/dasLLVM/tests/cant_tune_bad_grids.das Require daslib/tune
modules/dasLLVM/src/dasLLVM.cpp Add llvm witness dynamic module
modules/dasLLVM/REVIEW.md Update intrinsic emitter test requirements
modules/dasLLVM/REVIEW.das Track witness token in descriptor scan
modules/dasLLVM/daslib/llvm_user_modules.das Use module_exists(target) for guarded require
modules/dasLLVM/daslib/llvm_jit_run.das Bump codegen version; enforce --jit-target on argv
modules/dasLLVM/daslib/llvm_jit_code.das Update [llvm_code] registration doc comment
modules/dasLLVM/daslib/llvm_exe.das Treat ast/network modules as whole-lib triggers
modules/dasLLVM/daslib/llvm_code.das Convert [llvm_code] to forwarded apply function
modules/dasLLVM/CMakeLists.txt Build witness module when dasLLVM enabled
modules/dasLLVM/.das_module Register witness before exposing llvm/* paths
modules/dasLLAMA/THIRD_PARTY_NOTICES.md Mention new en_us phoneme pack
modules/dasLLAMA/tests/test_vulkan_tier.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/test_vulkan_moe_cm2.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/test_vulkan_dec_tail.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/test_tts_kokoro.das Fix kokoro access; stage family via styletts2 load
modules/dasLLAMA/tests/test_tts_kitten.das Add image-by-path test; add arch citation
modules/dasLLAMA/tests/test_tower_helpers.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/test_repack.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/test_program_roots.das Recurse program-root scan into subdirs
modules/dasLLAMA/tests/test_mxfp4.das Make math_gen optional via ?llvm guard removal; improve skip text
modules/dasLLAMA/tests/REVIEW.md Clarify suite tagging + stocked artifact definition
modules/dasLLAMA/tests/_vk_kq_fixtures.das Require moved daslib/f16_cvt
modules/dasLLAMA/tests/_metal_kernel_common.das Require moved daslib/f16_cvt
modules/dasLLAMA/REVIEW.das Update image layout stamp hash
modules/dasLLAMA/REVIEW_TTS.md Allow corpus-identity exception for audio reruns
modules/dasLLAMA/REVIEW_MEASUREMENT.md Expand “route” definition incl wasm/AOT/reference
modules/dasLLAMA/REVIEW_IMAGE.md Clarify when IMAGE_VERSION bump required
modules/dasLLAMA/performance/setup_asr_rig.das Require daslib/tune shells
modules/dasLLAMA/performance/REVIEW.md Expand model-catalog consistency trigger
modules/dasLLAMA/performance/gen_site_records.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/performance/gen_profile.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/performance/gen_bench_records.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/performance/fetch_models.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/performance/establish_baselines.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/performance/build_tts_data.das Build en_us phoneme pack
modules/dasLLAMA/harness/tune_kernels.das Require moved intrinsics + add daslib/tune shells
modules/dasLLAMA/harness/tune_confirm_prefill.das Use daslib/tune + explicit llvm_tune
modules/dasLLAMA/harness/tts_model_card.md Document en_us pack + loader fallback
modules/dasLLAMA/harness/tq4_order_probe.das Require moved daslib/f16_cvt
modules/dasLLAMA/harness/tq4_basis_probe.das Require moved daslib/f16_cvt
modules/dasLLAMA/harness/smmla_probe.das Require moved daslib/aarch64_neon
modules/dasLLAMA/harness/REVIEW.md Tighten dot_q8q8_laneq4x4 ordering rule
modules/dasLLAMA/harness/publish_tts_hf.py Include en_us pack in HF publish
modules/dasLLAMA/harness/parity.das Add backend pin flag + logging
modules/dasLLAMA/harness/p2_skw2_probe.das Require moved daslib/f16_cvt
modules/dasLLAMA/harness/moe_kq_probe.das Require moved daslib/f16_cvt
modules/dasLLAMA/harness/gen_tune_probe.das Require moved daslib/f16_cvt + add daslib/tune
modules/dasLLAMA/harness/accel_contention_probe.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama.das Document per-context fork pool requirement
modules/dasLLAMA/dasllama/dasllama_tune_scope.das Re-export daslib/tune; optional llvm_tune
modules/dasLLAMA/dasllama/dasllama_tts_types.das Move Kitten/Kokoro family structs to shared types
modules/dasLLAMA/dasllama/dasllama_math_accelerate.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama_math_aarch64_neon.das Use target-arch fold for backend registration
modules/dasLLAMA/dasllama/dasllama_load.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama_kv_codec.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama_kokoro.das Remove GGUF meta load; use shared family type
modules/dasLLAMA/dasllama/dasllama_kitten.das Remove GGUF meta load; use shared family type
modules/dasLLAMA/dasllama/dasllama_image.das Allow AOT-linked tier past gguf interp guard
modules/dasLLAMA/dasllama/dasllama_gpu_resident.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama_gguf.das Require moved daslib/f16_cvt (re-export)
modules/dasLLAMA/dasllama/dasllama_gemm_schema.das Move vbmi/pm1 helpers into schema module
modules/dasLLAMA/dasllama/dasllama_gemm_gen.das Remove duplicated vbmi/pm1 helpers
modules/dasLLAMA/dasllama/dasllama_g2p.das Add us_only pack flag + british refusal
modules/dasLLAMA/dasllama/dasllama_convert.das Require moved daslib/f16_cvt
modules/dasLLAMA/dasllama/dasllama_common.das Make tune shells always present; optional llvm_tune re-export
modules/dasLLAMA/CMakeLists.txt Clarify dasLLAMA AOT tier stance
modules/dasLLAMA/CLAUDE.md Document --no-tune portable/reference mode
modules/dasLLAMA/benchmarks/REVIEW.md Clarify what changes require new measurements
modules/dasLLAMA/benchmarks/matmul/matmul_variants.das Require moved daslib/aarch64_neon
modules/dasLLAMA/benchmarks/matmul/bench_metal_moe_lab.das Require moved daslib/f16_cvt
modules/dasLLAMA/benchmarks/matmul/bench_metal_gemv_kernels.das Require moved daslib/f16_cvt
modules/dasLLAMA/ARCHITECTURE.md Update architecture index entries
modules/dasLLAMA/ARCHITECTURE_MEASUREMENT.md Document no-framework ladder behavior
modules/dasLLAMA/ARCHITECTURE_INVARIANTS.md Update tier contract to include AOT/exe
modules/dasLLAMA/ARCHITECTURE_IMAGE.md Document AOT/exe as compiled tiers
modules/dasLLAMA/ARCHITECTURE_ENGINE.md Document optional framework + exchange guarding
modules/dasLLAMA/ARCHITECTURE_CPU_KERNELS.md Document target-based tier selection
modules/dasAccelerate/src/dasAccelerate.h Add AOT header for accelerate bindings
include/daScript/simulate/REVIEW.md Clarify perf claims vs shipped flags
include/daScript/simulate/aot_builtin.h Expose target fold + func tier checks to AOT
include/daScript/simulate/aot_builtin_jobque.h Expose jobque affinity setters to AOT
examples/dasLLAMA/wasm/run_node.js Add node runner for wasm64 host
examples/dasLLAMA/storyteller/.das_package New storyteller package + wasm disables
examples/dasLLAMA/speak.das New CLI TTS “speak” tool
doc/source/stdlib/handmade/function-builtin-get_target_triple-0x6b5a8940c4c62c1.rst Document get_target_triple
doc/source/stdlib/handmade/function-builtin-get_target_architecture_name-0x5a46cb8acf2fed30.rst Document get_target_architecture_name
doc/source/reference/tutorials/dasLLAMA_16_text_to_speech.rst Document dual-pack phoneme behavior
doc/source/reference/language/modules.rst Document module_exists vs builtin_module_exists
doc/source/reference/language/generic_programming.rst Add module_exists trait docs
doc/REVIEW.md Update checklist architecture pointers
doc/reflections/das2rst.das Add target fold functions to grouping
daslib/x64_avx.das Remove obsolete comment block
daslib/REVIEW.md Add intrinsic/JIT-table coupling rule
daslib/f16_cvt.das Minor comment tweaks; moved module
daslib/daspkg.das Add release_wasm_disable_module hook
daslib/ARCHITECTURE.md Document tune shells + module_exists contract
CMakeLists.txt Include examples/dasLLAMA for AOT examples
.github/workflows/REVIEW.md Clarify pages.yml list rule applicability
.github/workflows/extended_checks.yml Remove second lint rail invocation
modules/dasLLVM/daslib/llvm_jit_code.das Update doc comment for tune ownership
site-dasllama/sitemap.xml Publish examples page URL
site/files/examples.js Adjust browser version guidance
Review details
  • Files reviewed: 237/240 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread doc/source/reference/tutorials/dasLLAMA_16_text_to_speech.rst
Copilot AI review requested due to automatic review settings September 5, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updated daspkg tune-scope release test still hard-depends on llvm being configured and should skip cleanly when dasLLVM is absent to match the PR’s stated “no-LLVM build” portability goal.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 237/240 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread utils/daspkg/test_daspkg.das
Copilot AI review requested due to automatic review settings September 5, 2026 23:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The change spans core compiler/typeinfo behavior, module loading semantics, build system, and web/AOT/wasm plumbing across many areas, so it warrants a final human review for integration risk.

Review details
  • Files reviewed: 238/241 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 5, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The change set spans core compiler/runtime behavior, module loading semantics, and multiple build tiers (AOT/wasm/JIT), so it warrants careful human validation beyond the minor issues flagged here.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

daslib/daspkg.das:218

  • The doc comment lists module names (das_metal, das_accelerate), but --disable-module matches dynamic module folder names case-insensitively (e.g. dasMetal, dasAccelerate). This mismatch can cause users to disable the wrong thing and have guarded requires resolve as present during wasm cross-compiles.
    skills/daspkg.md:348
  • This table row suggests disabling das_metal / das_accelerate, but --disable-module is a case-insensitive folder-name match (e.g. dasMetal, dasAccelerate). Recommend listing the folder spellings to prevent users passing module/category names that won’t disable anything.
  • Files reviewed: 237/240 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

borisbat and others added 18 commits September 5, 2026 19:44
…es (no-LLVM build on reference bodies, an AOT example target, WASM64), with the kernel test coverage audit as stage 0 and the settled cut - inert annotation shells in daslib, the framework whole in dasLLVM

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… the gate that every set_source_files_properties path exists (a moved per-flag TU otherwise builds the ordinary way and stays green), the tests-cpp checklist's lane rule covers a subject that compiles to an unexercised implementation on some lane, the simulate hot-path rule names the shipped build as the judge, and the C++ test skill stops claiming a small test never needs a CMake edit

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s before any kernel moves - six new units (the tuned elementwise set, activations and fp32 GEMM, the q8q8 family promoted from the hand-run probes with the s16 arm and group3, rope application, the prefill and KV CPU kernels, the tower/audio/TTS kernels), an fp64 reference beside test_groupn's self-consistency compare, a loud skip where test_mxfp4's gen arm returned silently, the parity rails pinnable to one backend through DASLLAMA_PIN_BACKEND (restored on exit), the twelve suite-less test files registered in the model-free gate, and matmul_q8q8_batch's doc claim narrowed to the backend it holds on

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e f32 plane on portable and envelope-bounded on a generated backend - the rebased tree stamps a different profile and the two stamps fold the row tail differently

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… keys its half-convert intrinsics on the module name, which stays), the NEON tier's require in the engine takes the ?llvm/daslib/aarch64_neon path guard, and run.das gains --no-tune (DAS_TUNE_POLICY=reference in every child) - the portable tier's arm of the gate

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…b/tune.das) that forward to the framework when dasLLVM is mounted and do nothing otherwise - the framework's classes turn into plain functions, the auto-policy infer pass moves with them because macro state is per module; [tuned] and dasllama_tune_scope take the path guard and fall back to the declared or default perm with no sidecar; the exchange is a guarded require in the server and the bench (404 without the framework); builtin_module_exists also sees a shared das module the compiling program required, so lint and the other tool-driven compiles audit the same arm the run takes

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…vt - pure das, zero requires, recognized by module name - so the NEON tier and the generated families' reference bodies compile without dasLLVM and their [init] registrations self-gate; the guards on both engine requires go, math_gen's llvm_tune re-export takes the path guard, and the three pure lattice table builders test_kquant borrowed from the IR generator move to dasllama_gemm_schema

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rence policy is a different box identity, and a .dlim minted under it GC-purges the box's tuned images; test_audio_embedder's direct-image cell picks the image the rail would mint for THIS identity instead of the first gemma4a-tagged file in directory order

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…under static_if - the last unguarded llvm_tune symbol in the engine's kernel closure; without dasLLVM the q8q8 family, the prefill CPU kernels and the whole kq ladder now run interpreted

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rch alone: a kernel-free -exe targets the generic ARMv8.0 machine, where a name-recognized sdot4 was a fatal Cannot select under the reference tune policy

A standalone exe targets the host CPU only when it carries [llvm_code] kernels; with the
tune framework short-circuited there are none, so the NEON tier's reference bodies met a
baseline machine that has no SDOT. g_target_arm64_dotprod (host rail: always, via the
+dotprod append; generic and cross rails: the force env) now gates the sdot4 family and
the idot ss form, g_target_arm64_i8mm gates smmla, and a force-env feature reaches the
generic machine's string so the gates and the machine stay one truth. CODEGEN_VERSION
0x6e.

Gates: tests/jit_tests/aarch64_neon.das compares every NEON intrinsic against a
reference copy inside jitted helpers (a no-arg pure helper was const-folded, so they
take a salt); exe_host_cpu.das builds a kernel-free exe that calls sdot4, smmla and
the AVX2 dot on the baseline (red on the pre-fix emitter) and checks its answer;
test_exe_smoke is green under DAS_TUNE_POLICY=reference.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… CPU engine's C++ stubs linked in, reproduces the JIT reference run token-exact on SmolLM2; five general AOT fixes rode along

examples/dasLLAMA/CMakeLists.txt builds dasllama_aot (opt-in): DAS_AOT_LIB over the engine
minus the Vulkan and Metal tiers, the LLVM IR generators and the exchange server, plus the
daslib modules the CPU path calls that libDaScriptAot does not carry. Run it as
bin/dasllama_aot -use-aot examples/dasLLAMA/run.das -- <model.gguf>.

What the engine needed from the rest of the tree:
- -use-aot now compiles the script with policies.aot (and tune_frozen, the generator's
  policy) so the linked stubs bind; a function with no stub interprets. Only dastest honored
  the flag before. The per-PR AOT subset gate stays green (1724/1724).
- guard_interp_inference and guard_interp_gguf_load read the AOT tier through
  aot_kernels_linked(): is_aot_function on one kernel, a runtime probe. aot_enabled() folds
  differently under generation and the consuming run and would desync every caller's hash.
  ARCHITECTURE_INVARIANTS.md sec.3 carries the adjusted rule.
- das_accelerate had no aotRequire; a C++ module without one AOT-disables every das module
  whose require closure reaches it, silently - the engine above dasllama_math_accelerate
  emitted empty TUs. The module now ships dasAccelerate.h.
- topoSortStructures read a function type's parameter types as by-value dependencies, saw a
  false cycle and fell back to source order, where C++ embeds an incomplete type.
  collectStructDeps skips function, lambda and block types; a residual container cycle keeps
  the sorted prefix. Gate: tests/aot/test_struct_order.das.
- das_is_aot_function / das_is_jit_function and the jobque affinity pair are declared in the
  AOT headers the generated C++ includes.

Decode runs 54 t/s against the JIT reference policy's 360 on the same model - the
vectorization leg the plan names, not a measurement.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…path-guarded das target answers the same inside a tool's nested compile; builtin_module_exists keeps its process-registry meaning

builtin_module_exists reads the process's registered and promoted modules. A running
script promotes the shared das modules it requires, a nested compile (lint, the language
server, a test harness) promotes nothing, so every static_if over a path-guarded das
target took the framework arm at run time and the no-framework arm under every tool. The
earlier one-line widening of builtin_module_exists is reverted; the new trait asks
program->library instead. Every path-guarded das site in the tree (llvm_tune, llvm_code,
dasllama_exchange, dasllama_gemm_gen) now asks module_exists; C++-module guards are
unchanged. Gate: tests/language/optional_require.das. Docs and the skill references
carry both traits.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… never the filesystem's - every LLVM guard is `require ?llvm`, and module_exists answers what is visible from the compiling module

dasLLVM is a pure-das dasbind package, so its files sit on disk in every checkout and the
path guard `?llvm/daslib/llvm_tune` satisfied itself in a build configured without LLVM: the
tune framework loaded, read sidecars, and the IR generator was one call from LLVM.dll. The
two shapes that matter, a wasm build where no tuning may exist and a console build with the
LLVM sources present for the PC build but configured out, both need the configure to decide.
modules/dasLLVM/src/dasLLVM.cpp is a C++ module named `llvm` with nothing in it, compiled
in exactly when the package is (its .das_module registers the shared module silently, so a
build without it registers nothing); every guard is now `require ?llvm <target>`.

module_exists tightens from "in the program's library" to "visible from the compiling
module" (isVisibleDirectly): the first shape answered true for a module another module
required while this one's guarded require had been skipped, and the taken arm then called
into a module it could not see. The one site that asked about a guard rather than its
target (llvm_user_modules, dasllama_gemm_gen for dasllama_gemm_register) asks about the
target, which is what the JIT's generator registration needs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…s off require ?vulkan in the transformer, verified with --disable-module dasvulkan; a model-free no-GPU-modules gate is owed once the suite rework lands

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…get_target_architecture_name fold for the artifact a compile emits, the tune framework's inert gate fires on any --jit-target, and the engine's kernel-tier gates ask the target arch

get_architecture_name is a #if on the host compiler, so under --jit-target=wasm64 on an
arm64 box the engine's [init] gates registered the NEON tiers into the wasm artifact, and
the tune framework stamped the host's sidecar into it. Two SideEffects::none builtins
answer for the target instead: the --jit-target triple ("" native) and the arch parsed off
it (the host's with no triple). tune_aot_gate adds the cross-target condition, so [tune],
[tuned] and [llvm_code] emit reference bodies only; the three tier gates in the engine ask
get_target_architecture_name. get_architecture_name now answers wasm64 on a memory64 build.

The --jit-target argument sits after the -- separator, which the module cache's key ignored:
a cached native compile served the cross one with the host's folds (get_cross_platform_name
included). It keys the cache now. Gate: tests/jit_tests/cross_target_folds.das, three
children with the default cache on - native, wasm64 and x86_64-linux compile-only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the wasm64 web tree from the host-generated engine C++, and the node driver reproduces the JIT run token-exact on SmolLM2

web/CMakeLists.txt adds this tree as a subdirectory, so the target already existed there with
the wrong generator: the `daslang` target is a .wasm in that build. Under emscripten the repo's
host daslang generates (one generated set serves both builds - 8-byte pointers on each side,
every layout static_assert holds under em++), the executable links libDaScript instead of
libDaScriptAot (whose stubs the wasm daslang would have to generate), the engine's das files
and its .das_module embed into MEMFS beside daslib, ENV joins the exported runtime methods so
the driver can hold the image rail off, and the initial heap grows to 512 MB for the AOT type
tables. The Accelerate driver's TU stays out wherever das_accelerate is not built - its C++
calls the binding by symbol - which covers every non-Apple native build too.

examples/dasLLAMA/wasm/run_node.js mounts the repo and the model's directory through NODEFS
and calls main with -use-aot. Output matches the native JIT run; decode 46 t/s under node 25.
No dasLLVM is embedded: require ?llvm is false inside the artifact.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…erated C++ and .jitted_scripts caches outweighed the .das files twenty to one, and rode into every wasm artifact - dasllama_aot drops from 306 MB to 60 MB, the playground's daslang_static loses the same 95 MB

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…lusions

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
borisbat and others added 16 commits September 5, 2026 19:44
…laxed_dot_i8x16_i7x16_add_s through the sign trick (extmul + pairwise adds where relaxed SIMD is absent), +relaxed-simd joins the wasm feature string, and the portable q8q8 kernels pick a vector-epilogue idot4 dot on a wasm target - 4.8 to 13.8 GMAC/s on one lane, Kitten in Chrome 0.4x to 0.25x real time

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… full pack's 14.0): build_g2p_data.py --dialect us drops the British values and prunes CMUdict of every word the American lexicon carries, the reader refuses British on it by name, the facade takes whichever pack sits beside the model, the web shell fetches the American one; the publish set, the card and the provenance table carry it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…2p_en_us.bin

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…33 stays, the closure hash moves with the TTS image meta

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t alone, and the six kernel units get their area rows (five llm, the ASR tower one audio)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…m64 build on its own page under the site's nav; the model set is a rolling GitHub release the deploy downloads beside the page, never a file in git

pages.yml builds the storyteller with the games (step 7) and stages it into the dasllama.io tree with `gh release download dasllama-web` - a missing build or set leaves a placeholder page, never a 404; the Caddy snippet sends the two cross-origin-isolation headers under /examples/ (the -pthread wasm64 needs SharedArrayBuffer), and serve.py mirrors them plus maps /examples/<id>/ onto web/output64/examples for a local look that matches the deploy. The examples tab and footer link join every page and the story template; the page census (sitemap list, test_metadata, the deploy copy line) carries the new page.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…mpiled to wasm64 opens the dasllama.io examples page

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… Module_LLVM is a .shared_module name, not a module file

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…nd four architecture sections land where the comments pointed, with their anchors and citations; the storyteller and the tests name what the comments used to say

daslib/REVIEW.md: the JIT recognizes the three intrinsic modules by function name, so a new or renamed intrinsic changes its lookup row; an x64_avx tier reaches its narrower sibling, never scalar code. dasLLVM: ARCHITECTURE.md sec.9 (the idot family's three target lowerings, the relaxed-simd sign trick) cited from intrinsic_lattice_idot, idot_wasm_simd128 and wasm_target_features; REVIEW.md: forced target features append after the detected ones. dasLLAMA: ARCHITECTURE_CPU_KERNELS.md 2.42 (a CPU tier selects on the target, not the host) and ARCHITECTURE_TTS.md 2.43 (the two-tier phoneme pack); REVIEW_MEASUREMENT.md: a kernel-backend pin lands before the load it governs. dasllama-server: README.md gets its first anchor (the exchange policy's config path) and REVIEW.md the rule that no signature names an optional module's type. test_silu4_batch arms the job queue in its with_job_que blocks - the bare-queue tripwire caught it on the no-LLVM tier.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rtable program reaches it - the server, the bench, the profiling helpers and the modes fixture read the registry and the stamps only inside a module_exists arm, so every program root compiles with dasLLVM absent and the exe-rail lint sees no phantom registry; the team-lane wasm select is a def, the tune policy reads pin the module cache, forced JIT features announce themselves, the pages deploy checks every asset it stages, the deploy script splices the examples header idempotently, the program-roots census recurses, the no-tune arm refuses the image suites, and twenty-two rule and architecture documents say what their gates and code now do

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…se come back (the Inline module list in src/builtin, the shipped-exe decision in daspkg), the two documents that crossed 300 lines lose the lines they grew, the image layout stamp follows the TTS serializer's verify lines, the target folds get their reference text, g2p_pack_path is demonstrated in the TTS tutorial and grouped on its page, and the deploy script asks the dasllama.io vhost - not the whole Caddyfile - whether a block is already spliced

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…aths only with the witness, so a build without dasLLVM refuses a direct framework require instead of compiling it hollow; log_tune_status is one function in every build with the framework's row type kept behind the guard; the tune-scope ordering require is named as one; the image stamp follows the serializer's one-line comment

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…hout the modules, so its lint world was never one in-tree files answered to - CI lints the changed set once through daslang, preflight's lint gate runs the host and linux-mirror rails, the rail-skip flag and its helpers go, das-lint is still built and the bundle smoke still runs the shipped lint.exe on daslib

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… returns: arm64 for both arm triples, never aarch64

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… das2rst and just_in_time compile in a build without dasLLVM - the docs lane's daslang carries none, and the interpreter sweeps reach the JIT tests through just_in_time

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ped: the llvm/daslib files resolve wherever modules/dasLLVM sits and only the witness decides the guards, because a static host that never registers the witness still runs the JIT through the LLVM library (the C API JIT test), so just_in_time keeps its direct require; LLVM_JIT_EMITTER_HASH follows the idot and feature-string edits

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 6, 2026 02:54
@borisbat
borisbat force-pushed the bbatkin/dasllama-portable-tier branch from 3a5fcf9 to ba6f3f2 Compare September 6, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

daspkg release wasm splices disabled module names into a command string without fully enforcing the “no whitespace” constraint, leaving an argument-injection risk that should be fixed before merge.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 237/240 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread utils/daspkg/commands.das
…ash and dot, never dot or dot-dot - the strings it admits are spliced unquoted into run_cmd lines, so a space split argv and a semicolon ran; the three refusals say what the gate admits, and four unsafe bundle names are refused red-first before anything builds

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 6, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The local site preview server path mapping for /examples/ needs a Windows-safe drive/path guard to avoid os.path.join dropping the intended base directory.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 237/240 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread site-dasllama/serve.py Outdated
… by pattern: the resolved real path must sit under the examples root, so a doubled slash, a dot-dot or a Windows drive-qualified remainder falls through to the site tree instead of leaving it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 6, 2026 03:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It spans core compiler/runtime behavior, build configuration, optional-module semantics, and new wasm/AOT delivery paths across many subsystems, so it warrants final human review despite limited actionable findings.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

tests/README.md:47

  • tests/README.md says to keep the test index up to date when adding/removing/renaming files under tests/, but this PR adds several new test/fixture files that are not listed anywhere in the index (e.g. tests/daslib/test_tune_shells.das, tests/jit_tests/wasm_idot_lowering.das, tests/jit_tests/_wasm_idot_fixture.das, tests/language/optional_require_fixture_{private,hidden}.das). Please add appropriate rows under their respective sections so the index remains a reliable map of the suite.
  • Files reviewed: 237/240 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@borisbat
borisbat merged commit 87eeb08 into master Sep 6, 2026
35 checks passed
@borisbat
borisbat deleted the bbatkin/dasllama-portable-tier branch September 6, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants