Skip to content

mouse: 5 cards — linq_fold Phase 2C + dasImgui HDPI/build#2700

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/mouse-cards-batch
May 17, 2026
Merged

mouse: 5 cards — linq_fold Phase 2C + dasImgui HDPI/build#2700
borisbat merged 1 commit into
masterfrom
bbatkin/mouse-cards-batch

Conversation

@borisbat
Copy link
Copy Markdown
Collaborator

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 for take(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: glfwGetWindowContentScale in live_imgui_init, GLFW_SCALE_TO_MONITOR in harness_init, ScaleAllSizes(unsafe(GetStyle()), scale) after apply_daslang_theme. Includes the float* vs float& binding gotcha (must use safe_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 with DASLANG_DIR=...daspkg install /path/to/dasImgui --global --force (the --force is needed for every re-sync; -project_root alone won't trigger .das_module registration).

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

  • All 5 cards committed; no other tree changes
  • mouse__rebuild after merge (regenerates FTS5 index — not tracked, local-only)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 17, 2026 06:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`).
@borisbat borisbat merged commit fcf127d into master May 17, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants