optimize squirrel&lua profile tests#4
Merged
Conversation
34ecb21 to
5dff56f
Compare
use local functions
5dff56f to
43ea624
Compare
borisbat
added a commit
that referenced
this pull request
Dec 9, 2025
pass configuration options from external projects via llvm_config module
8 tasks
borisbat
added a commit
that referenced
this pull request
Apr 27, 2026
Fixes 7 review comments in one push: * MCP stdio safety (#1, #5): read_import and compile_and_collect both print warnings/failures to stdout, which corrupts the JSON-RPC protocol stream when called from the MCP server. Add `quiet : bool = false` to both helpers (default preserves CLI behavior); MCP find_duplicates passes true and surfaces failure counts via the returned envelope. * Test portability (#2, #3): replace hard-coded /tmp/... corpus path in test_find_duplicates_corpus_not_found with create_temp_file_result + immediate remove() — guaranteed-nonexistent path that works on Windows runners. * Newline-delimited paths (#4): MCP do_find_duplicates now normalizes \n to , before parse_file_list, matching the README's documented "git diff --name-only | …" pipeline use case. * Project (.das_project) plumbing (#6): add `project` to the find_duplicates schema, dispatch, and handler signature; thread through to compile_and_collect, which now takes `project : string = ""` and uses make_file_access(project) instead of the previous hardcoded "" — matching the convention used by compile_check / lint / find_symbol. * Deterministic compile order (#7): both the MCP tool and CLI main.das build a sorted array<string> from `keys(against_files)` and iterate that, instead of the unspecified-order table-key iteration. Makes per-candidate report ordering and --check exit behavior reproducible across runs. Drive-by: PERF006 fix in resolve_against_files (reserve before push loop). All test suites still green: 6987 in tests/, 54 find_dupes, 181 MCP (includes 5 updated find_duplicates tests for new signature). MCP end-to-end smoke confirms newline-delimited paths and project parameter both reach the handler. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
borisbat
added a commit
that referenced
this pull request
May 12, 2026
#1 DasGlfw_ChainClear restores prev callbacks before erasing the map entry. Without this, the dispatcher stays installed but early-returns on every real event, silently disconnecting ImGui_ImplGlfw and any other prior listener. #2 ApngWriter::enqueue validates stride_bytes >= row_bytes and rejects null pixels. Negative or too-small stride was being cast to size_t and underflowing into OOB reads. #3 stbi_apng_frame docstring now matches the implementation: positive stride only, always returns 1 on success, drops oldest on overflow (visible via stbi_apng_dropped). The prior copy claimed negative stride and a 0-return-on-full contract, neither of which exists. #4 mouse_click validates `action` and returns a structured error on anything other than "press" / "release". Typos like "pressed" no longer silently flip to release. #5 mouse_play sorts the wire timeline by t_ms before building the internal queue, so out-of-order input no longer drops earlier events. Extracted MouseEventWire + sort_play_events into a small standalone module (live/mouse_events) so the regression test under tests/dasglfw/test_mouse_play_sort.das can require only the algorithm, not glfw_live's full GLFW/OpenGL chain. The module is marked options no_aot to keep the test interpreter-friendly under test_aot. tests/aot/CMakeLists.txt registers tests/dasglfw/ alongside the other test directories. #6 record_start clamps `fps` to >= 1.0 and stores/reports the effective value, instead of accepting a sub-1 fps in status output while running the scheduler at the clamped rate. #7 record_tick resyncs next_capture_t to `now + frame_interval_s` after a stall instead of catch-up bursting. delay_ms now reflects the actual elapsed time between captures so playback timing matches the real spacing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
borisbat
added a commit
that referenced
this pull request
May 13, 2026
Five fixes from the round-1 review on PR #2645. Copilot #1 — Leak on glGenBuffers id==0 early return: The `id == 0u` early return path now glDeleteBuffers the partial allocation and `delete pbos` before returning the error, so a pathological driver doesn't leak GL buffers + the local array. Copilot #2 — stbi_write_set_png_compression_level was global mutation: RecorderState gains `prev_png_level`. record_start captures the current level via `stbi_write_get_png_compression_level()` before setting it to 4, then record_stop restores it. The writer-open-failure cleanup path also restores. Screenshot and any unrelated PNG writes are no longer permanently throttled to the tutorial-friendly level. Copilot #3 — glUnmapBuffer return value ignored: harvest_one_pbo now captures glUnmapBuffer's return; GL_FALSE means the driver invalidated the buffer contents while it was mapped, so treat it as a harvest failure rather than letting potentially junk pixels into the apng stream. Copilot #4 — record_stop drain comment was wrong: The previous comment claimed failures were "logged via the dropped counter", but `stbi_apng_dropped()` only reports encoder queue overflows inside the writer — not GL-side harvest failures. Comment now states behaviour accurately: a failed drain breaks the loop and the resulting `frames` count reflects what actually made it to disk. aleksisch — unsafe audit + narrowing: Several `unsafe { ... }` blocks wrapped calls that don't actually need unsafe in daslang (int-only arg lists, GLenum-only arg lists, null-data variants of GL buffer functions). Drops: - stbi_write_set_png_compression_level (int arg only) - stbi_apng_dropped / stbi_apng_end (void? writer, no raw ptr exposed) - glBufferData(target, size, null, usage) (null data variant) - glUnmapBuffer (GLenum arg, GLboolean return) - glReadPixels(..., null) into bound PBO (null data variant) Remaining unsafe is narrowed from `unsafe { ... }` to `unsafe(expr)` on the bare expressions that genuinely need it (every `addr(pbos[0])` call returning a raw pointer, and `stbi_apng_frame` which takes a raw `void*` pixel pointer). A general lint rule for redundant `unsafe` is out of scope for this PR — separate followup. While there, two STYLE005 lint hits fixed by switching to postfix `break if`/`return if`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
use local function