Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
51487de
playground: ?example= overrides autosave + JIT radio auto-reverts
borisbat May 22, 2026
6cfae0d
jit: panic on link failure
aleksisch May 21, 2026
8777fea
dadslang: return non-zero exit code on leaks
aleksisch May 21, 2026
10fea2a
jit: fix leak
aleksisch May 21, 2026
edb3346
Address PR #2810 Copilot review
borisbat May 22, 2026
317627f
lint: add self lint check
aleksisch May 22, 2026
98823d0
jit: forward sanitizer flag
aleksisch May 22, 2026
64d7153
lint: lint style_lint
aleksisch May 22, 2026
d70a560
Address PR #2810 Copilot round 2
borisbat May 22, 2026
1ea6186
tests/playground: harden three-file-reload against CI flake
borisbat May 22, 2026
d4c88e7
perf_lint: add PERF023 — drop pre-clone before qmacro splice (76-site…
borisbat May 22, 2026
af224a7
Potential fix for pull request finding
borisbat May 22, 2026
3566593
Merge pull request #2813 from GaijinEntertainment/aleksisch/self-lint
borisbat May 22, 2026
5521fc4
Merge pull request #2810 from GaijinEntertainment/bbatkin/playground-…
borisbat May 22, 2026
8ecccf7
Merge pull request #2814 from GaijinEntertainment/bbatkin/perf023-red…
borisbat May 22, 2026
8ce45f5
jit: allow override linker in JIT from command line
aleksisch May 22, 2026
785eed1
jit: wrap memset with null check
aleksisch May 22, 2026
b1159b7
Revert "ci: always use sccache"
aleksisch May 22, 2026
439e441
Revert "ci: cache build results on pull request"
aleksisch May 22, 2026
35bf427
Merge pull request #2793 from GaijinEntertainment/aleksisch/jit-retur…
borisbat May 22, 2026
9232b5b
Merge pull request #2816 from GaijinEntertainment/aleksisch/revert-sc…
borisbat May 22, 2026
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
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@ jobs:
;;
esac

# sccache on PRs: per-TU content-hash cache via GHA backend. Master clean.
- uses: mozilla-actions/sccache-action@v0.0.10
- run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV

- name: "Build: Daslang"
run: |
set -eux
Expand Down Expand Up @@ -303,6 +296,22 @@ jobs:
- name: "Test"
run: |
set -eux
# When daslang is sanitizer-instrumented, its JIT-emitted .dll cache
# link cmd needs -fsanitize=<kind> to pull the sanitizer runtime
# (otherwise unresolved __ubsan_*/__asan_*/__tsan_* symbols in lib.so).
JIT_LINKER_STRING=""
case "${{ matrix.sanitizers }}" in
ubsan) JIT_LINKER_STRING="--jit-linker-string=-fsanitize=undefined" ;;
asan) JIT_LINKER_STRING="--jit-linker-string=-fsanitize=address" ;;
tsan) JIT_LINKER_STRING="--jit-linker-string=-fsanitize=thread" ;;
esac
# daslang built with clang on sanitizer matrix — JIT-emitted .dll
# must link with the same compiler (incompatible asan/tsan runtimes
# otherwise). c++ default = g++ on Ubuntu, mismatches.
JIT_PATH_TO_LINKER=""
if [ "${{ matrix.sanitizers }}" != "none" ] && [ -n "${{ matrix.sanitizers }}" ]; then
JIT_PATH_TO_LINKER="--jit-path-to-linker=clang++"
fi
case "${{ matrix.target }}${{ matrix.architecture }}" in
linux64)
cd bin
Expand All @@ -314,7 +323,7 @@ jobs:
printf 'leak:format_error\nleak:uriParseSingleUriA\nleak:uriMakeOwner\n' > suppressions.txt
export LSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt"
# Use more time to pass UBSAN and disable leaks in JIT mode because we exit using exit(), and do not call destructors.
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ASAN_OPTIONS=detect_leaks=0 ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --timeout 900 --test ../tests || ASAN_OPTIONS=detect_leaks=0 ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ASAN_OPTIONS=detect_leaks=0 ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --timeout 900 --test ../tests || ASAN_OPTIONS=detect_leaks=0 ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --isolated-mode --timeout 3600 --test ../tests
./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
;;
windows32)
Expand All @@ -323,7 +332,7 @@ jobs:
;;
windows*)
cd bin/"${{ matrix.cmake_preset }}"
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- --timeout 900 --color --failures-only --test ../../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --isolated-mode --timeout 3600 --test ../../tests
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --timeout 900 --color --failures-only --test ../../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --isolated-mode --timeout 3600 --test ../../tests
./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --timeout 900 --test ../../tests || ./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --isolated-mode --timeout 3600 --test ../../tests
;;
linux_arm64)
Expand All @@ -334,12 +343,12 @@ jobs:
# runs JIT — keep --failures-only off there so PASS lines print and
# name the test running just before the hang if it reoccurs (see
# RC2 release run #25572466058).
[ "${{ env.das_llvm_disabled }}" = "ON" ] || [ "${{ matrix.cmake_preset }}" = "Debug" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- --color --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
[ "${{ env.das_llvm_disabled }}" = "ON" ] || [ "${{ matrix.cmake_preset }}" = "Debug" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --isolated-mode --timeout 3600 --test ../tests
./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
;;
*)
cd bin
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
[ "${{ env.das_llvm_disabled }}" = "ON" ] || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -jit -- $JIT_LINKER_STRING $JIT_PATH_TO_LINKER --color --failures-only --isolated-mode --timeout 3600 --test ../tests
./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --timeout 900 --test ../tests || ./daslang _dasroot_/dastest/dastest.das -- --color --failures-only --isolated-mode --timeout 3600 --test ../tests
;;
esac
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/extended_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ jobs:
./vcpkg/vcpkg install openssl:x64-windows --binarycaching
echo "VCPKG_ROOT=$(pwd)/vcpkg" >> $GITHUB_ENV

# sccache on PRs: per-TU content-hash cache via GHA backend. Master clean.
- if: github.event_name == 'pull_request'
uses: mozilla-actions/sccache-action@v0.0.10
- if: github.event_name == 'pull_request'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> $GITHUB_ENV

- name: "Build: Daslang (Release)"
run: |
set -eux
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Full migration table (when reading older docs that say `var inscope` or `<-` for
| `unsafe { ...; unsafe { ... }; ... }` (nested `unsafe { }` block) | drop the inner wrap | STYLE026: outer `unsafe` already covers the whole inner scope, so the inner block is pure noise. Closure / lambda / generator bodies are NOT nested for this rule — they execute in a separate context where the outer wrap does not propagate |
| `for (s in A) { B \|> push(s) }` / `push_clone(s)` (iter-var only) | `B \|> push_from(A)` / `push_clone_from(A)` | PERF022: the bulk overload in builtin.das reserves combined capacity up front. Single name `push`/`push_clone` is overloaded between single-element and bulk (ambiguous when destination is `array<T[]>`); the `_from` suffix names the bulk intent. Source must be `array<T>` or C-array — range/iterator sources are not flagged. `emplace` is out of scope (const iter-var can't be moved) |
| `var a : array<T>; for (x in SRC) { if (COND) { a \|> push(EXPR) } }` (or `table<K;V>` + `insert`/`a[k]=v`) | `var a <- [for (x in SRC); EXPR; where COND]` (or `\{for (...); k => v; where ...\}`) | STYLE027: var with empty default-init followed by a for-loop that only push/insert into it. Accepts depth ≤ 2 nested fors and if-filters at any depth. `emplace` excluded — move-source-zeroing differs from comprehension element-construction. Iterator-comprehension form (`[$f ...]`) NOT suggested |
| `var X = clone_expression(E); ... $e(X) ...` (only-uses-are-qmacro-splice) | drop the pre-clone, inline `$e(E)` at each splice site | PERF023: `qmacro`/`qmacro_block`/`qmacro_expr`/`qmacro_block_to_array` go through `apply_template` (templates_boost.das:251), which calls `clone_expression` on every substitution input. Pre-cloning is wasted work. Detection: post-expansion `$e(X)` becomes `add_ptr_ref(X)` inside an `ExprMakeBlock`; visitor tracks splice-wrapper depth via preVisitExprCall/visitExprCall counter on `add_ptr_ref`, classifies each candidate `ExprVar` reference as "safe" when depth>0. Fires only when ALL uses are safe AND ≥1 is observed. Multi-clone-of-same-source flagged too — apply_template clones each substitution independently |

For path/filename ops use `fio` helpers (`base_name`/`dir_name`/`path_join`/etc.) — see `skills/filesystem.md`. Never hand-roll `rfind("/")` / slice — misses Windows separators.

Expand Down
3 changes: 1 addition & 2 deletions daslib/ast_match.das
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,8 @@ def private generate_const_constructor_match(call : ExprCall?; folded_rtti : str
body |> push <| qmacro_expr(${ var $i(cast_var) = $e(as_cast); })
if (!has_tags_in_args(call)) {
// Fast path: all args are constants — clone the call, compiler folds it, compare with !=
var pat_clone = clone_expression(unsafe(reinterpret<Expression?>(call)))
let pat_var = next_var(index)
body |> push <| qmacro_expr(${ var $i(pat_var) = $e(pat_clone); })
body |> push <| qmacro_expr(${ var $i(pat_var) = $e(unsafe(reinterpret<Expression?>(call))); })
var cond = qmacro($i(cast_var).value != $i(pat_var))
qm_const_value_guard(at, cast_var, actual_var, cond, body)
} else {
Expand Down
Loading
Loading