mouse: 5 cards — linq_fold Phase 2C + dasImgui HDPI/build#2700
Merged
Conversation
Three linq_fold cards from Phase 2C (PR #2697) that didn't make it into the merged PR: - chained-select splice: bind via clone-assign universal (drops the prevWorkhorse-only guard) - macro planner: named-marker arms leave room for future modes - splice macro: bounded loop guard for take/skip non-positive N Two dasImgui cards from this session (HDPI PR borisbat/dasImgui#42): - HDPI plumbing pattern (glfwGetWindowContentScale + ScaleAllSizes + GLFW_SCALE_TO_MONITOR hint; float* binding gotcha) - Local daspkg install dance (out-of-tree dasImgui build + --global --force re-install to propagate edits; -project_root won't substitute) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds five “mouse” Q&A cards capturing learnings from the linq_fold Phase 2C work and dasImgui HDPI/build workflows, to reduce future rediscovery of those patterns.
Changes:
- Document take/skip bounded-loop guard semantics for non-positive bounds in splice macros.
- Document a macro-planner structure using named marker arms for future emission modes.
- Document dasImgui HDPI scaling plumbing and a local build + daspkg install workflow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| mouse-data/docs/splice-macro-bounded-loop-guard-take-skip-non-positive-n.md | Notes correct take/skip guard comparisons to match iterator semantics on non-positive bounds. |
| mouse-data/docs/macro-planner-named-marker-arms-leave-room-for-future-modes.md | Describes using explicit “marker arms” for planned-but-unimplemented operators in chain recognition. |
| mouse-data/docs/chained-select-splice-bind-via-clone-assign-universal.md | Captures the bind-via-:= pattern for splicing chained selects and avoiding ExprRef2Value substitution issues. |
| mouse-data/docs/how-do-i-make-dasimgui-hdpi-aware-what-s-the-canonical-scale-plumbing.md | Summarizes the canonical 3-point DPI scaling plumbing for dasImgui (scale read, GLFW hint, ScaleAllSizes). |
| mouse-data/docs/how-do-i-run-a-dasimgui-demo-locally-what-s-the-build-daspkg-install-dance.md | Records the local dev flow for building daslang + dasImgui out-of-tree and installing via daspkg. |
Comments suppressed due to low confidence (2)
mouse-data/docs/how-do-i-run-a-dasimgui-demo-locally-what-s-the-build-daspkg-install-dance.md:16
- This card hardcodes a contributor-specific absolute path (
/Users/borisbatkin/...). For portability and to avoid embedding personal paths in-repo, please switch to placeholders (/path/to/...,$HOME/...) similar to other mouse cards (e.g./Users/<you>/...).
dasImgui is a **sibling repo** (`/Users/borisbatkin/Work/dasImgui`, not under `daScript/modules/`). To run any dasImgui example or test locally:
**1. Build daslang first** (provides `lib/liblibDaScriptDyn.dylib`, `bin/daslang`):
cd /Users/borisbatkin/Work/daScript
cmake --build build --config Release -j 8
**mouse-data/docs/how-do-i-run-a-dasimgui-demo-locally-what-s-the-build-daspkg-install-dance.md:40**
* The note about `-project_root` is misleading: daslang *does* initialize dynamic modules by scanning `<project_root>/modules` for `.das_module` descriptors (see `include/daScript/ast/dyn_modules.h` and `utils/daScript/main.cpp`). If the intent is "it won’t work when pointing at the dasImgui repo root because it has no `modules/` subdir", please state that explicitly.
Do NOT use -project_root /path/to/dasImgui — that flag exists but doesn't trigger .das_module initialize for register_dynamic_module. The canonical resolver path is via das_root/modules/<name> populated by daspkg.
</details>
---
💡 <a href="/GaijinEntertainment/daScript/new/master?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
|
|
||
| ```das | ||
| // Take guard — break when limit reached. | ||
| // `>=` (not `==`): for N <= 0, takenCount=0 already satisfies `0 >= -N`, breaks |
|
|
||
| **Why this matters**: when the future mode lands, it grafts in at the existing named arm — no re-walking the chain-recognition logic, no risk of accidentally enabling broken splice for an op that needs full-source materialization. A single `else: return null` catch-all would force the future PR to identify which name belongs in which mode, re-implement the recognition, and risk shadowing the wrong arm. | ||
|
|
||
| **Concrete location**: `daslib/linq_fold.das` `plan_loop_or_count`. Buffer-required marker arm landed in Phase 2C Ring 3 (2026-05-17, PR …); the actual emission modes are deferred to Phase 3+. The marker also doubles as documentation: a reader sees exactly which operators have planned-but-unimplemented support, vs. which are forever-out-of-scope. |
| links: [] | ||
| --- | ||
|
|
||
| Verified 2026-05-16. |
| links: [] | ||
| --- | ||
|
|
||
| Verified 2026-05-16 (dasImgui PR #42, branch `bbatkin/hdpi-theme-scaling`). |
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.
Summary
Five blind-mouse Q&A cards that accumulated across two sessions:
linq_fold Phase 2C (from PR #2697 — should have shipped together):
chained-select-splice-bind-via-clone-assign-universal.md— chained-select splice binds via:=(clone-assign) universally; prevWorkhorse-only guard dropped.macro-planner-named-marker-arms-leave-room-for-future-modes.md— macro planner uses named-marker arms (take_skip_emit,chained_select_emit, …) instead of dense if/else so adding a mode later is local.splice-macro-bounded-loop-guard-take-skip-non-positive-n.md— bounded loop guard fortake(N <= 0)/skip(N <= 0): emit nothing rather than panic.dasImgui HDPI session (from borisbat/dasImgui#42):
how-do-i-make-dasimgui-hdpi-aware-what-s-the-canonical-scale-plumbing.md— the canonical 3-place plumbing:glfwGetWindowContentScaleinlive_imgui_init,GLFW_SCALE_TO_MONITORinharness_init,ScaleAllSizes(unsafe(GetStyle()), scale)afterapply_daslang_theme. Includes thefloat*vsfloat&binding gotcha (must usesafe_addr(xs)).how-do-i-run-a-dasimgui-demo-locally-what-s-the-build-daspkg-install-dance.md— local dev flow: build daslang → build dasImgui out-of-tree withDASLANG_DIR=...→daspkg install /path/to/dasImgui --global --force(the--forceis needed for every re-sync;-project_rootalone won't trigger.das_moduleregistration).Why
Both sets are pure cache adds. The linq_fold cards encode patterns from already-merged work that next-session-Claude will otherwise re-derive from git history. The dasImgui cards short-circuit the same re-discovery for any future HDPI / theme work.
Test plan
mouse__rebuildafter merge (regenerates FTS5 index — not tracked, local-only)🤖 Generated with Claude Code