Skip to content

[pull] master from GaijinEntertainment:master#997

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

[pull] master from GaijinEntertainment:master#997
pull[bot] merged 8 commits into
forksnd:masterfrom
GaijinEntertainment:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 15, 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 : )

profelis and others added 8 commits May 15, 2026 18:08
fix: ensure proper GC collection on serialization failure
Two cards from the dasImgui PR #32 session:

  * how-do-i-embed-a-bound-cpp-struct-as-a-daslang-state-field-and-what-
    binding-overrides-do-i-need — the four C++ ManagedStructureAnnotation
    overrides (isLocal / canBePlacedInContainer / hasNonTrivialCtor /
    canCopy) needed before a daslang state struct can embed a bound C
    value field, plus the two daslang-side overrides (JV +
    archive::serialize) that short-circuit json_boost's and
    LiveVarsPass's field walkers. Surfaced one error at a time during
    the ImGuiTextFilter embed work for the Example Console port —
    documents the cbind_boost-emits-only-two-of-four gotcha and the
    pure-daslang escape hatch as a reality check.

  * how-do-i-rebuild-a-loaded-daslang-shared-module-when-linker-fails-
    lnk1104-dll-locked — the rename-then-build workaround for the case
    where MCP has the DLL mapped. Keeps the session alive across
    multiple rebuild cycles without forcing the user to kill MCP.
    Documents the in-process vs subprocess code-loading distinction
    (fresh daslang.exe subprocesses see the new code; MCP-internal
    compile_check sees the old until MCP restarts).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
paranoid_collect (and its perf_lint / style_lint twins) were slow because
get_file_source_line walked from byte 0 every call, counting '\n'. Each
candidate warning hit is_suppressed -> get_file_source_line, so per-file
cost was roughly O(warnings x file_size). The per-line scanners in
style_lint (source_line_between, check_defer_pipe, scan_file_lines)
amplified this to O(L^2) on big files.

Three changes in one PR:

1) Lazy line-offset index on FileInfo (debug_info.{h,cpp}). buildLineIndex
   builds a vector<uint32_t> of line-start byte offsets on first call;
   getLine is O(1) thereafter. get_file_source_line rewritten to use it.
   Every existing caller (3 lint modules + 8 sites in utils/fix-lint-errors)
   benefits transparently. Tiny memory overhead (~4 bytes per source line,
   per file, lazy).

2) Unified lint suppression API. Two new C-side scanners in rtti_core
   (module_builtin_rtti.cpp): rtti_get_source_line and the pointer-math
   rtti_is_nolint_suppressed (no std::regex, no allocation). daslib/rtti.das
   exposes is_lint_suppressed(at, code) + extract_lint_code(text). The three
   in-tree lint visitors collapse to one-liners; future custom lints
   (imgui_lint, decs_lint, user code) just require daslib/rtti and call
   is_lint_suppressed.

   Recognized nolint forms (all backward-compatible):
     // nolint:CODE
     // nolint:CODE1,CODE2,CODE3
     // nolint:CODE1 nolint:CODE2     (repeated directives, e.g.
                                       modules/dasPEG/peg/parser_generator.das:543)
     // prose nolint:CODE more prose  (directive anywhere after //)

3) reported_locations: array<uint64> -> table<uint64> (set form) in
   perf_lint and style_lint. Linear has_value scan -> O(1) hash lookup.

Tests:
- tests-cpp/small/test_file_info_line_index.cpp: FileInfo::getLine truth
  table (LF/CRLF, idempotent build, out-of-range, single-line) and
  rtti_is_nolint_suppressed truth table (all four forms above, substring
  traps, null guards).
- tests/rtti/test_lint_suppression.das: extract_lint_code.
- tests/lint/test_nolint_suppression.das: end-to-end paranoid_collect
  over a 3-LINT003 fixture with 2 suppressions; asserts count == 1.

tests/aot/CMakeLists.txt registers the new test dirs for AOT compilation.

Wall-time on tutorials/ (215 files): 43.66s -> 42.37s. Modest because
tutorials produce 0 lint warnings, so the per-warning fast path isn't
exercised - the structural fix compounds dramatically on files with many
warnings. Issue count: 0 -> 0 (no semantic drift).

Verified: Release + Debug builds clean; tests-cpp 22/22; AOT mode pass for
tests/lint, tests/rtti, tests/daslib, tests/language (939/939), tests/strings
(361/361).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three cards accumulated during the dasImgui `_no_imgui_legacy` lint
detour (PR #29) — captured but not yet committed:

  * imgui2rst-strict-struct-fields-docstring-count — the //!-per-field
    requirement enforced by daslib/rst.das's strict_struct_fields rule.
    Real failure mode: imgui2rst CI panics "has less documentation than
    values, expected at least N lines" when a class's //! block has
    fewer lines than fields. Fix shape: one //! per public field.

  * lint-macro-opt-in-via-options-find-arg — the
    `prog._options |> find_arg("...") ?as tBool ?? false` early-return
    pattern that makes a [lint_macro] opt-in per file via
    `options _flag = true`. Mirrors the `_comment_hygiene` /
    `_no_imgui_legacy` shape; off-by-default lints don't fire on every
    consumer until they opt in.

  * lint-macro-skip-qmacro-synth-calls-via-fileinfo — the combined
    skip in preVisitExprCall: bail when the containing function is
    generated OR when the call's at.fileInfo differs from the
    containing function's. Avoids false positives on calls baked into
    user code by qmacro splices (e.g. `with_id` PushID/PopID emitted
    inside a user body).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot caught a garbled sentence on the DLL-rebuild card: the original
text mashed two ideas together with a non-grammatical `via` and named a
PowerShell command that doesn't actually work — `Win32_Process` CIM
instances don't expose a `.Modules` property.

Split into two coherent sentences and corrected the command to use
`Get-Process` (System.Diagnostics.Process — its `.Modules` collection
DOES list loaded DLLs). This is the form actually used during the
dasImgui session that surfaced the card; the original write-up was a
transcription error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…fo-line-index

lint: O(1) FileInfo line index + unified suppression API in rtti_core
…-may15

mouse: 5 cards from dasImgui PR #29 lint detour + PR #32 Example Console port
@pull pull Bot locked and limited conversation to collaborators May 15, 2026
@pull pull Bot added the ⤵️ pull label May 15, 2026
@pull pull Bot merged commit 1ff9a53 into forksnd:master May 15, 2026
@pull pull Bot had a problem deploying to github-pages May 15, 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.

2 participants