Skip to content

[pull] master from GaijinEntertainment:master#838

Merged
pull[bot] merged 12 commits into
forksnd:masterfrom
GaijinEntertainment:master
Mar 22, 2026
Merged

[pull] master from GaijinEntertainment:master#838
pull[bot] merged 12 commits into
forksnd:masterfrom
GaijinEntertainment:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Mar 22, 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 12 commits March 21, 2026 20:55
Detect push, push_clone, emplace on arrays inside loops without a
preceding reserve() call. Uses propagateWrite-style expression chain
walking to trace through field access (self.items), index, deref,
cast to find the root variable and check scope.

Key features:
- Field path tracking: reserve(t.a, N) does not suppress warning for t.b
- Conditional suppression: push inside if/else is not flagged
- Closure suppression: push in lambda/block inside loop is not flagged
- fromGeneric-based function matching for builtin generics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detect push, push_clone, emplace on arrays inside loops without a
preceding reserve() call. Uses propagateWrite-style expression chain
walking (ExprField, ExprAt, ExprCast, etc.) to trace through field
access chains and find the root variable.

Key features:
- Field path tracking: reserve(t.a, N) does not suppress warning for t.b
- Known-length loop detection: only warns in for loops with known-length
  sources (array, range, fixed_array, string), not iterators/generators
- While loops always warn (user controls the bound)
- Conditional suppression: push inside if/else is not flagged
- Closure suppression: push in lambda/block inside loop is not flagged
- inferStack reporting: warnings on generic instances show instantiation chain
- fromGeneric-based function matching for builtin generics

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add reserve() before push/emplace loops in 15 daslib files:
aot_standalone, apply, ast_cursor, coverage, dap, das_source_formatter,
daspkg, debug, decs_state, json, match, rst, spoof, templates,
typemacro_boost.

Fix json_boost JV generic: reserve for is_array/is_dim sources.
Fix templates.das: store hashes in array, build_string after loop.
Fix perf_lint.das: use build_string for inferStack message (require strings).

Improve PERF006 accuracy:
- While loops no longer trigger (bound is runtime-dependent, can't reserve)
- Update test file with while loop as good pattern

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tiny fixed-size loop (4 hex chars max), reserve adds overhead for no benefit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pre-allocate vertex and index arrays in gen_sphere and gen_cylinder
based on computed sizes. Fixes PERF006 warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- linq: reserve in zip_impl/zip3_impl (min of source lengths, require math)
- json_boost: reserve in from_JV array deserialization
- soa: reserve in generated from_array and to_array functions
- geom_gen: reserve vertices/indices in gen_sphere/gen_cylinder
- arcanoid: reserve in gen_rounded_cube geometry
- gameplay/test_gameplay: reserve in build_double_deck, test hand array
- 34_decs tutorial: reserve in entity creation loop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add PERF006 rule and fix perf_lint warnings across codebase
- Add `perf_lint` MCP tool: runs PERF001-006 checks on .das files via
  `perf_lint_collect()` API (single file, batch, glob support)
- Add `lint` MCP tool: runs paranoid lint checks via `paranoid_collect()`
  API (unused vars, unreachable code, const suggestions)
- Add `compile_only()` helper in common.das (compile without simulate)
- Add `write_deduped()` helper for collapsing duplicate messages (x26)
- Both tools compile with no_optimizations to match lint-pass timing
- Refactor perf_lint.das: add collect_warnings mode + perf_lint_collect()
- Refactor lint.das: add collect_errors mode + paranoid_collect()
- lint.das: skip generated variables and canShadow for-loop variables
  (filters out decs ECS query bindings)
- decs_boost.das: mark index-lookup query variables as generated
- Fix lint warnings in arcanoid (var->let, remove unused hw)
- Fix live_vars.das: var->let for extractData result
- Standalone perf_lint tool: add no_optimizations for correct AST
- 8 new tests (4 perf_lint + 4 lint), all passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes PERF006 warnings in the collect functions themselves.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Lint sweep across daslib/ and modules/ using the new lint MCP tool.

daslib fixes:
- aot_cpp.das: remove unused vars, var->let, comment unreachable code
- aot_standalone.das: remove dead disableInit, shadowed modules_str
- ast_print.das: comment unused bfa, var->let
- coverage.das: unused for-loop var, var->let

Module fixes:
- dasAudio/audio_boost.das: 6x var->let for variant reads
- dasAudio/audio_live.das: var->let for extractData
- dasGlfw/glfw_live.das: var->let for extractData
- dasLiveHost/decs_live.das: var->let for extractData
- dasLiveHost/live_commands.das: var->let
- dasOpenGL/opengl_state.das: 2x var->let
- dasOpenGL/points/points.das: unused loop var, 3x var->let
- dasOpenGL/points/sdfi.das: 3x var->let, 2x unused loop var, unused tmax

C++ fix:
- module_builtin_fio.cpp: stat/fstat bindings used modifyExternal but
  take FStat& -- changed to modifyArgumentAndExternal so compiler
  correctly tracks argument modification

Also adds utils/mcp/lint_issues.md tracking lint false positives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix lint warnings across daslib and modules
@pull pull Bot locked and limited conversation to collaborators Mar 22, 2026
@pull pull Bot added the ⤵️ pull label Mar 22, 2026
@pull pull Bot merged commit 61fbc46 into forksnd:master Mar 22, 2026
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