Skip to content

[pull] master from GaijinEntertainment:master#969

Merged
pull[bot] merged 5 commits into
forksnd:masterfrom
GaijinEntertainment:master
May 7, 2026
Merged

[pull] master from GaijinEntertainment:master#969
pull[bot] merged 5 commits into
forksnd:masterfrom
GaijinEntertainment:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 7, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

borisbat and others added 5 commits May 7, 2026 02:26
…fold

benchctl
- replace hand-rolled flags.das with daslib/clargs (single struct,
  positional command + files, structured filters)
- replace raw sqlite3_* calls in bench_sql.das with [sql_table]
  Benchmark + with_sqlite + db |> insert(rows) bulk + _sql(... |>
  select_from |> _where(...)) for query and compare paths
- structured filter flags (--commit / --tag / --old-commit / --old-tag
  / --new-commit / --new-tag) replace user-supplied --select raw-WHERE;
  flag composition uses _sql || empty-string short-circuit so one call
  site covers all flag combinations
- isolate clargs in bench_args.das (private require) to work around an
  Option<string> ambiguity bug when daslib/clargs and sqlite/sqlite_boost
  are in the same module (filed as #2598)
- delete bench_sql.das, flags.das; add bench_args.das, bench_table.das
- README rewritten for the structured-flag surface

benchmarks/sql/
- new comparison suite mirroring tests/dasSQLITE/parity_check_*.das
  shape but oriented to throughput: _common.das fixture +
  select_where.das, select_where_order_take.das, count_aggregate.das
- 6 modes per file: m1m / m1d (_sql, mem/disk), m2m / m2d (no _sql,
  select_from materializes, mem/disk), m3 (array LINQ), m3f (_fold
  fused array LINQ); disk DBs created+deleted outside timed block
- benchmarks/README.md adds the sql/ section

daslib/linq_boost
- new fold_where_count + ["where_", "count"] FoldSequence: emits a
  single-pass invoke($(source) { var n; for it in source; if pred(it)
  n++; return n }, top) with the predicate spliced via fold_linq_cond
- eliminates intermediate filter array AND block-call overhead
- count_aggregate m3f: 25.5 -> 8 ns/op (INTERP), 3 ns/op (JIT); zero
  alloc; ~5x faster than _sql at 10K rows in memory

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot review on PR #2599:
- run_reset_cmd now uses try_drop_table_if_exists / try_create_table and
  returns an error string; the implicit-init path propagates it instead
  of crashing on a corrupt or locked DB.
- run_query_cmd rejects multiple --tag values for query (previously
  silently used only the first); compare-side scalar flags unchanged.
- Insert tag loop skips empty tags and rejects '[' / ']' in tag values
  (the bracket scheme cannot delimit them safely).
- README annotates --tag as single-value for query, bracket-free for
  insert.

benchmarks/sql/ simplification (per Boris): drop the m1d / m2m / m2d
modes (disk vs memory was a one-shot finding; no-_sql DB modes only
re-prove that select_from materializes -- already documented). Each
file now compares 3 modes: m1 (_sql over :memory:), m3 (plain array
LINQ), m3f (_fold-fused array LINQ). Removed disk_db_setup / cleanup
helpers from _common.das; updated benchmarks/README.md mode matrix.
count_aggregate bumped to 1M; per-element cost is flat from 100k -> 1M
across all three modes (m1 38, m3 12, m3f 3 ns/op).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nt fold test

Copilot review round 2 on PR #2599:
- run_subcommand validates `cmd` against {reset, insert, query, compare}
  before opening the SQLite DB. Typos (e.g. `qurey`) no longer create
  an empty benchdata.db as a side effect.
- Extracted validate_tag_chars helper; insert/query/compare all reject
  '[' or ']' in tag values consistently (previously only insert did).
- run_compare_cmd restores the overlap-exclusion semantic the old code
  had: collects --old result IDs into a table<int;bool> and post-filters
  --new entries against it. Identical/empty filters on both sides can no
  longer compare a result set against itself. Implemented in daslang
  (no raw-SQL escape hatch).
- benchmarks/README.md table previously claimed `count_aggregate` ran
  at 100K; updated to 1M to match the shipped benchmark constant.

Two adds:
- benchmarks/sql/indexed_lookup.das — point-lookup benchmark
  (`_where(_.id == K)` against PRIMARY KEY) at 1M rows. Inverse-asymmetry
  pair to count_aggregate: SQLite's b-tree wins by ~1000x (m1 ~3 us,
  m3 ~9 ms, m3f ~3.4 ms per lookup at JIT). Documents where indexed
  storage earns its keep.
- tests/linq/test_linq_fold.das — regression test for the where+count
  fold rule added in fcb6481. Covers half-match, zero-match, all-match,
  and empty-source cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
benchctl: clargs + sqlite_linq rewrite, sql/ benchmarks, where+count fold
@pull pull Bot locked and limited conversation to collaborators May 7, 2026
@pull pull Bot added the ⤵️ pull label May 7, 2026
@pull pull Bot merged commit fa13a2e into forksnd:master May 7, 2026
@pull pull Bot had a problem deploying to github-pages May 7, 2026 20:58 Error
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant