[pull] master from GaijinEntertainment:master#1008
Merged
Conversation
MCP requires HV. Let's enable HV by default so MCP server will be available in default builds. It requires fixing thread-safe bug in libHV: ithewei/libhv#835 And fixing our CMakeLists for ASAN on linux.
… projection Closes two `KNOWN PERF GAP` items from PR #2712 + a long-standing qmacro parser limitation surfaced while implementing them. Net result: spliced order/sort and select+where chains now beat in-memory SQLite on every headline shape. Gap 1 — comparator key double-call in `partial_sort`. Splice planner inlines pure single-expression keys into a comparator block and dispatches to new `top_n_by_with_cmp(arr, K, cmp)` library entry (array + iterator variants in `daslib/linq.das`). Direction is encoded by flipping the comparator arg order (`_::less(body[v2], body[v1])` for desc); no separate `_descending` variant needed, eliminating the secondary wrapper lambda the existing desc family adds. Falls back to keyed `top_n_by` when the key has side effects or isn't a single-expression lambda. Gap 2 — projection double-eval in `select + where + terminator`. Phase 3d inlined `projection` into `predicate` via peel-substitution; lane emitters also cloned `projection` into `valueExpr`, so the projection evaluated twice per element on ARRAY / ACCUMULATOR / EARLY_EXIT lanes. The where-after-select arm now binds `projection` to a fresh local via a new `preConditionStmts` slot (per-element, OUTSIDE the if-wrap), then rewrites `projection` to reference that bind — predicate (peel) and valueExpr (clone) share the single eval. COUNTER lane is explicitly excluded (no body use; extra bind would regress its single-stmt fast path). Side-effecty projections still bail to tier 2 (moving them outside the if would visibly fire side effects on filter-rejected elements). Parser bonus — `src/parser/parser_impl.cpp:885`. Multi-arg `$($i(a) : T, $i(b) : T) { ... }` qmacro form failed parse with `30701: block argument is already declared MACRO TAG` because the parser stamped every `$i(...)` in block-arg position with the literal placeholder name and dup-checked them before macro tag resolution. Fixed by skipping the dup check when `name_at.tag != nullptr` — genuine post-resolution dups surface as ordinary local-lookup conflicts during type inference. General-purpose; usable by any macro that emits a typed block with N tagged-name args. Tests: - 4 new tests in `test_linq_fold_ast.das`: Gap 2 dedup-proof (literal `7919` appears exactly once in the spliced body), select+where impure bailout + per-element call-count assertion, Gap 1 side-effecting-key fallback + correctness. - 5 existing AST-shape tests updated to match new emission (top_n_by → top_n_by_with_cmp; order_by → order(arr, cmp); order_by_inplace → order_inplace). Benchmarks (100K rows, INTERP): - sort_take m3f 56 → 27 ns/op (2.1×; beats SQL at 38) - order_take_desc m3f 56 → 27 ns/op (2.1×; beats SQL at 38) - select_where_order_take m3f 39 → 24 ns/op (1.6×; beats SQL at 36) - select_where_sum (NEW) m3 59 / m3f 7 ns/op (8.4× over m3; 5.3× over SQL) - select_where_count m3f 5 ns/op (unchanged — COUNTER lane correctly excluded) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
build: enable hv by default
…-single-eval linq_fold: single-eval splice — inline pure keys + dedup select+where projection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )