100 Commits
Author SHA1 Message Date
4DBug 6e9790bf2a extensions: submodule pointers -> the rewritten extension commits on their remotes (imcurveedit-luau 4998eaf, imgradient-luau 227f1a0, imgui-memory-editor-luau 8249fe2, imnodes-luau 357fc01, imsequencer-luau d09550e; same trees as the old 9769fd0 / 21b3b2d / 3c9aca1 / 363fd65 / a911077, which no longer exist upstream)
Build & Release / build (push) Canceled after 0s
2026-10-25 06:23:44 -05:00
4DBug d1818970b5 0.4.4
Build & Release / build (push) Canceled after 0s
Performance update (Roblox), no API changes; pixels identical to 0.4.3.
- Raster: solid spans 4-8 px per loop iteration, full-width rows copied in blocks, bit32 colour unpacking (colorpicker -19%, implot -13%, fonts -16%)
- Raster: axis-aligned edges tested once per row / column, AA fringe rows with alpha 0 skipped, triangle / line quad spans from per-side edge slots, narrow spans (vertical lines, histogram bars) without row bookkeeping (plots up to -25%)
- ImPlot rect fills (heatmaps, bars) drawn as one primitive instead of two triangles (implot -3.5%)
- DirtyRects: greedy diff of a tile's old and new primitive list, so scrolling no longer redraws everything after the first shifted row (scroll: 14.1k -> 4.3k pixels rasterized per frame)
- Hover recolors skip tile hashing and redraw only the affected tiles; unrolled per-primitive vertex hash; per-command primitive data (CollectPrims -10%)
- Library: @native table layout functions, trunc helpers, ImDrawListSplitter:Merge() via table.move (demo -2..4% instructions)
- stb_truetype: CFF-only / font-init functions no longer @native, -312 KB native code (more headroom under Studio's native code budget)
- Fix: clicking right after the Studio/game window regains focus (without moving the mouse first) did nothing
- Extensions: submodules point at the current implot-luau, imguicolortextedit-luau, implot3d-luau and imguizmo-luau commits
- tests: t_recolor_pixels, t_scroll_pixels, native_size.py (native code budget check)
2026-10-25 05:44:24 -05:00
4DBug b83d09de0c Roblox backend: forget the last mouse position when the window gains / loses focus (losing focus clears imgui's mouse to unavailable and NewFrame only resends a moved mouse, so a click on return without moving first landed nowhere); rebuilt build/ImGui.luau 2026-10-25 05:44:24 -05:00
4DBug 3bac70663f build: rebuild Roblox bundle + worker (span slots, ImPlot rect pairs, greedy dirty-rect diff, per-command primitive data, table natives, trunc helpers) 2026-10-24 06:09:18 -05:00
4DBug 132660be9a tools/test: t_scroll_pixels.luau (stress window with table + wrapped text scrolling down / up, resizing from the bottom-right and the top-left, composite every 3 frames: incremental must equal a forced full redraw; catches DirtyRects list-diff mistakes) + check_all.sh 'scroll_pixels' check 2026-10-24 06:06:32 -05:00
4DBug 7c21be04de Roblox backend: a primitive's texture, texture id, vertex buffer and clip rect are its draw command's (PrimCmd -> Cmd* arrays, numbered through the frame) instead of 7 per-primitive arrays: CollectPrims writes 11 instead of 17 values per primitive, HashTiles / RasterRect / PrimHash / Parallel.Tile read them through PrimCmd (headless instructions per frame: implot -0.23M, plots -0.1M, scroll -0.09M, fonts -0.08M, resize -0.03M; CollectPrims -10%; pixels identical) 2026-10-24 05:55:53 -05:00
4DBug 8e6abeede9 Roblox DirtyRects: a greedy diff of the tile's old and new primitive list (lookahead 8 entries for the one that resyncs both, so an inserted or removed run is skipped; same flat rect: strips) instead of pairing them only by position when the counts match: a row scrolled out of or into a tile, or an entry shifted by one, no longer redraws every primitive after it. Any order-preserving pairing is exact. Two unpaired entries without a resync: the positional pass as before (mostly changed lists: new font size, animated plots) (headless: scroll PixelsRasterized 14.1k -> 4.3k/frame, Raster -25%, resize_tl 106k -> 82k px, resize 82k -> 78k px; instructions scroll -0.4M/frame, resize_tl -0.2M, others within +-0.1M; pixels identical) 2026-10-24 05:35:18 -05:00
4DBug b119b07676 Roblox HashTiles: the per-primitive vertex hash unrolled (2 vertices for quads, 3 for triangles, 4 for line quads / triangle pairs; was a loop with a branch per vertex; same math, same order: hashes identical) (headless instructions: scroll -0.1M/frame, resize -0.06M; Hash stage -5..9% plots/implot) 2026-10-24 05:34:25 -05:00
4DBug 9ef8a623cc tools/test/native_size.py: native code size of the bundle per module / source file / function vs the Studio limit (one script's native code must fit one ~4 MB block or none of it is compiled; measured in Studio: native at 4,083,418 bytes, interpreted from 4,103,258; master 3,153,274 = 77%, ~900 KB headroom); check_all.sh 'native' check; PORTING.md note 2026-10-24 05:33:08 -05:00
4DBug ff7a04187c Tables: @native TableUpdateLayout(), TableSetupDrawChannels(), TableSetupColumnFlags() (once per table per frame, the largest interpreted cost of table-heavy windows: demo_all -2.5% instructions; +176 KB native code, paid for by the stb_truetype trim; draw data identical) 2026-10-24 04:54:21 -05:00
4DBug b87012f08f stb_truetype: no @native on CFF-only functions (charstring interpreter, CFF index/dict parsing, cubic tesselation) and font-init-only ones (InitFont, table directory): never run per frame for TrueType fonts, native code -312 KB (Studio shares one native code budget across scripts); per-frame cost unchanged (fonts scenario instructions identical), startup -3% instructions (less to compile) 2026-10-24 04:54:21 -05:00
4DBug ca621e1082 Trunc helpers: _Trunc/ImTrunc @native, ImTrunc64 its own hoisted function (was an alias of _Trunc: AddRect()/AddRectFilled() called a non-native function per rect), IM_TRUNC/IM_ROUND hoisted + @native; bundle.py: A's local budget counts the hoisted functions (main chunk stays under 200 locals) (demo_all -1.7% instructions; draw data identical) 2026-10-24 04:54:21 -05:00
4DBug f2658b755e ImDrawListSplitter:Merge(): copy each channel's indices with table.move() (upstream memcpy) instead of a per-index loop in interpreted code (stress hover -0.8% instructions; draw data identical) 2026-10-24 04:54:21 -05:00
4DBug 620660ccf9 Roblox backend: flat triangle pairs a b c + a b d (ImPlot PrimRectFill: heatmap cells, bars; one colour, one uv) are one primitive (kind 5): per row both triangles' spans exactly as DrawTriangle computes them, one fill where they touch (opaque: or overlap), else each in order; pairs DrawTriangle would walk by columns, or degenerate ones, still go to the two calls (tile hash kind field * 8; replay: implot -3.5%; randomized 800k cases vs the two DrawTriangle calls identical; pixels identical) 2026-10-24 04:30:29 -05:00
4DBug 5ae58c6b57 Roblox raster: narrow flat spans (opaque <= 8 px, translucent <= 4 px wide: vertical lines, histogram bars) skip the uniform-row bookkeeping and only mark pending damage; translucent ones blend per pixel (cached per destination value), one pixel wide in one loop down the column (replay: plots -13%, implot -3%, resize -2%; pixels identical) 2026-10-24 04:16:31 -05:00
4DBug 8520257086 Roblox raster: triangle / line quad spans from per-side edge slots (one estimate + short search per side, no per-edge branches per row; horizontal / vertical edges bound the row / column range once), line quad texels blended without the per-texel cache and opaque-texel branches (replay: implot -5%, plots -5%, colorpicker -2.5%; pixels identical) 2026-10-24 04:08:59 -05:00
4DBug 8611bfb4ed build: rebuild Roblox bundle + worker (recolor patch, unrolled span/row writes, axis-aligned edge and alpha-0 edge skips) 2026-10-23 23:52:00 -05:00
4DBug b3e9390653 extensions: submodule pointers -> the rewritten extension commits on their remotes (implot-luau 7199224, imguicolortextedit-luau a340940, implot3d-luau 6ff7fb1, imguizmo-luau a71a223; same trees as the old 2bc5700 / 0592ed6 / b30d2ff / 93f4569, which no longer exist upstream) 2026-10-23 23:51:47 -05:00
4DBug 752ae2e887 Roblox raster: vertex-colour triangles skip a row / column lying on an edge whose two vertices have alpha 0 (an AA fringe's outer edge sits on pixel centres; the interpolated alpha is exactly 0 there, so it drew nothing) (replay: plots -3%, resize -1.5%; pixels identical) 2026-10-23 23:41:50 -05:00
4DBug c0fc18177f Roblox raster: an axis-aligned edge (A = 0 for rows, B = 0 for columns) is tested once per row / column instead of per pixel by the span search: AA fringes and shaded fills next to a vertical / horizontal edge no longer scan empty rows / columns pixel by pixel (replay: implot -8%, plots -12%, resize -5%; pixels identical) 2026-10-23 23:39:02 -05:00
4DBug 5c076f65d5 Roblox raster: solid spans 4-8 pixels per loop iteration (FillRow; a native loop iteration costs more than a few writes), opaque column walks 4 rows per iteration, translucent black over opaque 4 pixels per iteration without the cache (colour picker SV square), full-width span rows copied in doubling blocks (CopyRows), bit32 colour unpacking instead of % / floor (replay in Studio: colorpicker -19%, implot -13%, fonts -16%; pixels identical) 2026-10-23 23:39:02 -05:00
4DBug d1db51dded Roblox backend: PatchDrawList skips primitives with no vertex in the listed vertices' offset range before the DriftSet lookups (hover recolor patch -25%, drift moves too) 2026-10-23 23:19:40 -05:00
4DBug cef7a1209e Roblox backend: recolored draw lists (same vertex positions, a few vertices' colour / uv changed, e.g. hover) skip HashTiles: CompareDrawList 4 lists them, PatchDrawList gives those primitives their real hashes (PrimHash / FlatTileHash) and redraws just their tiles, leaving the tiles exactly as the full path would; t_recolor_pixels (incremental vs forced, also parallel) in check_all 2026-10-23 23:19:40 -05:00
4DBug 951d18fda2 Roblox backend: HashTiles mixes the primitive kind into its bounds term instead of two extra % after the second vertex (gradient rects, ImPlot line quads; implot Hash -4%, same pixels) 2026-10-23 23:19:40 -05:00
4DBug 006c8c4a34 tools/test: prof.py finds run.py's linemap in $TMPDIR (tempfile.mkdtemp), not only /tmp 2026-10-23 22:32:53 -05:00
4DBug 23e31fcf3c 0.4.3
Build & Release / build (push) Canceled after 0s
Performance update (Roblox), no API changes; draw data and pixels identical to 0.4.2.
- Unchanged check: CompareDrawList reads vertices as f64 + col (3x fewer reads), moved lists shift their snapshot in place
- Collect/hash ~40% cheaper per changed draw list; DirtyRects without copies, skips unchanged prims at the same position
- Raster straight into the upload buffer (no CopySubRect; Upload -80..90%), uniform row intervals, faster glyph blits, pending damage rect, two-pixel span writes, inlined blends in gradient/interpolating triangles, tall flat triangles as spans
- Tiles: no 64 KB CPU buffer per tile, 4 prewarmed tiles in the free list; atlas record buffers reused on repack
- Fix: windows moved by whole pixels could keep stale pixels where trig-generated vertices drift by 1 ulp (t_move_pixels)
- Library: @native on hot helpers, fewer temporaries (Begin, widgets, tables, PlotEx, colour checkerboard), pooled ImDrawCmd / style / group stack entries (55 -> 31 KB/frame on the bench scene); faster glyph baking (repack O(n), vertical-edge fast path)
- backends/roblox/patches.lua: Luau-tuned RenderText/AddText/text-size cache hit (Roblox only)
- bundle.py optimization L: library-internal ImGui.Foo calls become locals (Roblox; hookable deny-list: Begin, End, TreeNode*, CollapsingHeader, ItemAdd, ItemHoverable, ItemSize, BeginTabItem, ShowDemoWindow; IMGUI_BUNDLE_NO_L=1 turns it off)
- Parallel: Actors free destroyed textures (leak), send only changed glyph rects
- Extensions: implot-luau (range renderers, tick reuse, @native per-point paths), imguicolortextedit-luau (widest line + selection cached), implot3d-luau, imguizmo-luau (@native math)
- LÖVE backend: RegisterCanvas()/UnregisterTexture(), ReadFile via love.filesystem root
- tests: t_move_pixels, t_scene_pixels, t_stress, t_stress2 + bench_scenes.luau
2026-10-21 04:04:31 -05:00
4DBug 694d56a78f LÖVE backend: ReadFile also tries the root as a love.filesystem path (works in .love/fused builds); RegisterCanvas()/UnregisterTexture() to show an existing Texture/Canvas without the backend owning it; rebuilt build/imgui_love.lua 2026-10-21 04:03:58 -05:00
4DBug 635cf6647b build: rebuild Roblox bundle + worker (round 3: rasterizer gradients/lines, library plots/colour pickers/Begin temporaries) 2026-10-21 03:50:40 -05:00
4DBug 90efb0c6e1 extensions: imguicolortextedit-luau -> 0592ed6 (TextEditor: widest line + selected text cached, @native glyph loops), implot3d-luau -> b30d2ff, imguizmo-luau -> 93f4569 (@native per-point/math paths) 2026-10-21 03:50:31 -05:00
4DBug 6eb91d17e4 extensions: implot-luau -> 2bc5700 (round 3 ImPlot performance: range renderers, @native per-point helpers, tick reuse) 2026-10-21 03:35:40 -05:00
4DBug dfdfea5ea7 Roblox backend: RasterRect tests a primitive's bounds against the rect before reading its clip (most of a tile's primitives miss a small dirty rect) 2026-10-21 03:35:32 -05:00
4DBug c85b2dbb96 Roblox raster: solid spans written two pixels per writef64 (the pixel twice as a normal double; per pixel otherwise), translucent black spans without the colour terms (colour picker SV square), triangle / line quad rows start past an estimate that is never in the span (replay: colorpicker -13%, plots -7%, implot -5%; pixels identical) 2026-10-21 03:35:32 -05:00
4DBug 12059f2646 Roblox backend: DirtyRects skips AddRect for a changed primitive inside the first dirty rect (where AddRect would merge it, unchanged) 2026-10-21 03:35:32 -05:00
4DBug d99864c315 Roblox raster: per-pixel blend/texel sample inlined in the interpolating triangle paths (rows and columns) and gradient kind 2 (a call per pixel cost more than the math), colours unpacked inline (shared when equal), white texels not folded, flat span constants only when translucent; line quads: bounds before edge setup, fixed texel row when v is constant; narrow solid spans written instead of copied per row (replay: colorpicker -14%, plots -14%, implot -3%; pixels identical) 2026-10-21 03:35:32 -05:00
4DBug b2c8ce7a00 tools/test: t_scene_pixels (bench scenes animated, composited every 8 frames: incremental == forced redraw), in check_all (ImPlot scene when extensions/implot-luau is checked out) 2026-10-21 03:35:32 -05:00
4DBug a2e19627fe tools/test: hashes.sh finds luau/luajit in the nix store when the pinned paths are gone (like check_all.sh) 2026-10-21 03:00:35 -05:00
4DBug 278f978d3e Library: fewer temporaries per window, child, input field, separator text and resizable table: Begin() skips CalcWindowAutoFitSize() when no axis auto-fits (result unused; still called when a size callback would see it), scalar scrollbar/auto-fit/avail/needed sizes, ScrollbarSizes updated in place, scratch viewport/visibility rects, OuterRectClipped and the previous-child overlap test without ImRects; RenderWindowOuterBorders() scratch corner; EndChild() scratch size/bb; InputTextEx() scalar label/frame/inner sizes, scratch total_bb and (single-line, until ItemAdd() accepts it) frame_bb, so clipped fields allocate nothing; SeparatorTextEx() scratch sizes/rect/positions; TableUpdateBorders() scratch hit rect
demo_all scene headless: 825 -> 553 KB/frame allocated (Begin 5.3 -> 1.4 KB per window, InputTextEx 0.8 KB -> 0 per
clipped field), user instructions/frame -1.3%. GC steps in that scene cost ~+1.5 ms on 2-4 frames per cycle, so
cycles get ~1/3 rarer. Draw data unchanged.
2026-10-21 03:00:23 -05:00
4DBug 30afa19ed1 Library: PlotEx() without per-point temporaries (scalar tp0/tp1 and ImLerp, two scratch corners only read by AddLine()/AddRectFilled(), scalar frame/inner/total rects) and @native; RenderColorRectWithAlphaCheckerboard() with scratch cell corners and @native; @native ShadeVertsLinearColorGradientKeepAlpha() and _PathArcToN() (color picker hue wheel)
plots scene headless --roblox (interleaved A/B): lib lowq ~0.35 -> ~0.27 ms/frame; colorpicker lib lowq ~0.43 ->
~0.38 ms/frame. Draw data unchanged (STRESS2HASH of all scenes, draw hashes).
2026-10-21 03:00:23 -05:00
4DBug 2ff5225f49 Library: @native on DebugNodeFontGlyphsForSrcMask() (the font atlas glyph grids: a 256-entry scan per codepoint block + 256 AddRect/RenderChar per open block) and on small helpers called from native code (IM_ASSERT, IM_ASSERT_USER_ERROR_RET, ImHashStr's memo, ImVector __index/push_back/pop_back/back/iter)
demo_all scene (whole demo open, headless --roblox, interleaved A/B): lib ~10.1 -> ~9.1 ms/frame, user
instructions/frame -5%; draw data unchanged.
2026-10-21 03:00:23 -05:00
4DBug 5fa9889a37 tools/test: bench_scenes.luau (plots, colorpicker, implot, demo_all scenes shared by the Studio bench and headless runs) and t_stress2.luau (library + backend time and draw checksum per scene) 2026-10-21 01:58:35 -05:00
4DBug 6f4ec3c2b7 build: rebuild Roblox bundle + worker (round 2: bundle-time ImGui.* localization, patches.lua, library allocations, backend raster/bookkeeping) 2026-10-21 01:29:48 -05:00
4DBug 701156b5cc Roblox backend: reuse the destroyed atlas texture record's buffer for the next one of the same size (repack)
buffer.create of a 512 KB atlas costs ~0.1-1.8 ms in Studio (spiky); a repack creates one every few frames
in the font size scenario.
2026-10-21 01:24:28 -05:00
4DBug 086e66cb3e Roblox backend: keep 4 prewarmed tiles in the free list (Heartbeat, one per call, never evicting)
A growing layer takes them instead of creating an EditableImage + ImageLabel mid-frame (~90 us per tile in
Studio vs ~7 us from the free list). GetTile: one path for new and recycled tiles (NewTile).
2026-10-21 01:24:28 -05:00
4DBug 162fa80075 Roblox raster: tall flat triangles (column walk) write spans like the row path (no BlendPixel call per pixel)
Opaque: direct writes; translucent: the row path's per-span constants + per-destination cache. Same math,
bit-identical (replay hash, t_pixels, t_composite, t_parallel). Replay: triangles ~13 -> ~9 ms, total -5%.
2026-10-21 01:24:28 -05:00
4DBug 31d09640bf Roblox backend: DirtyRects skips primitives unchanged at the same list position (paired lists)
Every pixel such a primitive covers is either inside a changed primitive's rect or drawn by the same
primitives in the same order. Headless: 7% fewer pixels rasterized on resize, raster+upload -6..-9%.
2026-10-21 01:24:28 -05:00
4DBug 53b3489f68 Roblox backend: moved draw lists with drifted vertices: redraw just what they touch (and always redraw it)
A window moved by whole pixels often has a few trig-generated vertices off the exact shift by an ulp (when a
coordinate crosses a power of two): CompareDrawList fell back to the full Collect + Hash (~1/4 of moving
frames), and the tile hashes don't see an ulp, so those primitives were never redrawn (stale pixels vs a
forced redraw, e.g. a moving Bullet). Now CompareDrawList lists the drifted vertices; if all their floor /
ceil (CollectPrims' bounds) shifted too it returns 3: PatchDrawList keeps the tile lists (same primitive
sequence, checked) and marks only the drifted primitives' entries changed (DriftMark, new each frame), so
their tiles redraw just those rects. Otherwise the full path marks them the same way.
2026-10-21 01:24:28 -05:00
4DBug 2fc6d75ef8 tools/test: t_move_pixels (moving window with circles / rounded rects / bullets: incremental == forced redraw), in check_all 2026-10-21 01:24:28 -05:00
4DBug f2648316e7 bundle.py: optimization L (Roblox): library-internal ImGui.Foo reads in function bodies become per-file locals ImGui_Foo (file function or a wrapper around it, within the 200 locals/upvalues limits), bound after every IM_INCLUDE; only names assigned once at load time, patchable deny-list (Begin/End/TreeNode*/CollapsingHeader/ItemAdd/ItemHoverable/ItemSize/BeginTabItem/ShowDemoWindow) stays a table lookup; IMGUI_BUNDLE_NO_L=1 turns it off
ImGui has ~1000 keys, so Luau's inline cache (hash slots < 256) missed most ImGui.Foo lookups. 722 names localized;
draw hashes identical, LÖVE bundle unchanged, IMGUI_BUNDLE_NO_L=1 reproduces the previous bundle byte for byte.
2026-10-21 01:20:39 -05:00
4DBug 328f13a3c4 Library: tables without per-instance temporaries in BeginTableEx()/TableUpdateLayout()/TableMergeDrawChannels() (scratch rects, scalar outer size); ImDrawListSplitter::Merge() keeps the command it merges away past Size for reuse (was 6 new ImDrawCmd per table per frame): 435 -> 247 tables/frame allocated for 10 small tables in a window
Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug f3387cfe76 Library: no temporaries in Checkbox()'s check mark, Bullet(), Dummy(), NewLine(), ArrowButton[Ex](), InvisibleButton(), MenuItemEx() and InputScalar()'s step buttons
Per widget headless: MenuItem 658 -> 119 B, Bullet 611 -> 0 B, ArrowButton 634 -> 7 B, Checkbox 74 -> 7 B, NewLine 112 -> 0 B, Dummy/InvisibleButton 448/673 -> 112 B (the caller's own ImVec2). Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug 2b5887d166 Library: no temporaries in Selectable(), RadioButton(), SeparatorEx(), LabelText(), BeginCombo(), SmallButton(), ProgressBar() and the single-line InputTextEx() path (scratch rects/vectors only read by callees, scalar text sizes, shared read-only defaults; the multi-line backup of LastItemData only built when multi-line)
Per widget headless (bytes allocated, time): Selectable 724 -> 7 B, -15%; RadioButton 857 -> 7 B, -15%; Separator 336 -> 0 B, -14%; LabelText 1555 -> 0 B, -33%; BeginCombo 1541 -> 6 B, -17%; InputFloat 3838 -> 1741 B, -15%; ProgressBar 986 -> 437 B, -10%. Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug 9c965297ee Library: PushStyleColor()/PushStyleVar*()/BeginGroup() reuse the stack entry left past Size by the matching pop (C++ copies them into the vector's storage), EndGroup() without temporaries: no garbage per push/group (was 288/193/1952 bytes), per widget headless: PushStyleColor -14%, PushStyleVar -12%, BeginGroup+EndGroup -34%, DragFloat3 -11%
Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug de8e2fef08 Library: fewer temporaries per window in Begin() (scalar TitleBarRect()/CollapseButton() rects, viewport clip and contains tests, visibility rect, CalcWindowSizeAfterConstraint() writes its own copy, title bar rect only built for a hovered window): 21.4 -> 18.8 KB/frame allocated for one window of buttons/sliders, 46.6 -> 42.5 KB/frame in the Studio bench scene
Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug 015cd40172 Library: ImDrawList reuses its ImDrawCmd objects (AddDrawCmd() takes the command left past Size by last frame's resize(0)/pop_back(), Merge() swaps instead of clearing channel slots), _CmdHeader reset in place: ~9 KB/frame less garbage in the Studio bench scene
Draw data unchanged.
2026-10-21 01:14:31 -05:00
4DBug c740729106 Roblox backend: patches.lua, Luau-tuned replacements of hot library internals (text rendering, text size cache hit)
New backend module installed when the backend loads (the library sources stay the 1:1 port): MT.ImFont.RenderText and
MT.ImDrawList.AddText share one native core (clip rect as numbers, PrimReserve inlined, no CPU fine clip branches,
AddText without the clip rect copy and extra call); ImFontCalcTextSizeXY checks its cache hit first. Uncommon cases
(byte-table text, CPU fine clip, > 10k bytes unwrapped, texture change mid-text) go to the originals. One switch per
patch (Enabled), M.Set() for in-process A/B. Draw hashes, composite pixels identical; imgui time -3..-4% (Studio
in-process A/B and headless).
2026-10-21 01:04:21 -05:00
4DBug 76cfcf6e12 build: rebuild Roblox bundle + worker (backend and library performance work since 0.4.2) 2026-10-20 20:52:38 -05:00
4DBug 90363f4a6e Library: @native on small, frequently called helpers (style color stack, tree push/pop, indent, item size, draw list clip/cmd, glyph lookup, table column helpers)
Picked from a per-function call census of the whole demo opened (hundreds of calls/frame each); +~100 KB of native
code. Whole demo open (headless --roblox) 10.35 -> 9.84 ms/frame together with the previous commits; draw data unchanged.
2026-10-20 15:19:28 -05:00
4DBug b05d2535c0 tools/test: t_stress.luau, headless copy of the Studio bench scene (library CPU per frame + draw checksum) 2026-10-20 15:19:28 -05:00
4DBug 70df13d409 Library: drop @native from once-per-window/frame giants, fewer slow lookups in text helpers
- Begin/End/NewFrame/UpdateMouseInputs back to interpreted: ~520 KB of native code (Begin alone 369 KB, +30% of the
  bundle's native code) for ~5 us/frame; native code is a game-wide budget in Roblox
- GetCurrentWindow(): read g.CurrentWindow once (the key sits in a hash slot >= 256 of the ~300-field context, which
  Luau's inline cache can't predict, so every read is a slow lookup)
- FindRenderedTextEnd(): strings use string.find/string.len directly (no ImMemchr() call, no `#` on a string)
- CalcTextSize(): calls CalcTextSizeXY() directly (one wrapper level less); TextEx(): string.len() for strings

Draw data unchanged.
2026-10-20 15:19:28 -05:00
4DBug 46551df26b Library: fewer calls/lookups per text item, table cell and frame
- Text(): TextV() inlined (one vararg call less per formatted Text); TextEx(): CalcTextSize() inlined
- ImFontCalcTextSizeXY / RenderText / CalcWordWrapPosition: GetFontBaked() fast path inlined (LastBaked check)
- TableBeginCell(): SetWindowClipRectBeforeSetChannel() inlined; SetCurrentChannel(): skip the TexRef field reads
  when both commands share the same TexRef (as ImDrawCmd_HeaderCompare already does)
- UpdateKeyboardInputs / UpdateKeyRoutingTable: loop-invariant field reads hoisted
- `#` on strings replaced by string.len() in ImFontCalcTextSizeXY (`#` is not a native fast path)

Headless --roblox: stress+demo 0.98 -> 0.89 ms/frame, empty frame 0.085 -> 0.067 ms; draw data unchanged.
2026-10-20 15:19:28 -05:00
4DBug 713cd3c22a Library: @native on hot interpreted paths (Begin/End, NewFrame key loops, table rows, sliders, buttons, wrapped text, GetFontBaked)
Fewer native<->interpreter transitions on the per-item call chains. Stress+demo headless (--roblox) 0.98 -> 0.93 ms/frame,
draw data unchanged.
2026-10-20 15:19:28 -05:00
4DBug b75f183ecf Roblox backend: tiles no longer allocate a 64 KB CPU pixel buffer each (unused since dirty rects are rasterized straight into upload buffers) 2026-10-20 15:12:11 -05:00
4DBug 5f23d260fd Roblox backend raster: damage to the uniform rows collected in one pending rect (applied when a span needs them); spans process runs of rows with the same uniform piece at once 2026-10-20 15:11:51 -05:00
4DBug a20b7fcacf Roblox backend raster: uniform rows are only valid inside the last ClearRect (no reset passes) 2026-10-20 15:11:51 -05:00
4DBug efe16cc1e8 Roblox backend raster: glyph blits read consecutive texels without the column table, cache white-texel blends per alpha 2026-10-20 15:11:51 -05:00
4DBug 7a453fd8b7 Roblox backend raster: uniform region tracked per row instead of one rect (translucent spans over uniform rows fill instead of blending per pixel) 2026-10-20 15:11:51 -05:00
4DBug ad32fa4bd1 Roblox backend: rasterize dirty rects straight into the upload buffer (no CopySubRect, no cold 64 KB tile buffer) 2026-10-20 15:11:51 -05:00
4DBug 360e7b70bc Font atlas: ImTextureData:Create() reuses the pixel table of the last atlas texture removed after the backend destroyed it (same byte size, zero-filled with table.move doubling) instead of a new 512K-entry table per repack (texadd 92 -> 44 ms, bake bench -8% run side by side; atlas/glyph checksums and draw hashes unchanged) 2026-10-20 14:47:54 -05:00
4DBug 08953d4270 Parallel: Actors free destroyed textures (each atlas grow/repack left a full copy in every Actor), atlas patches send the updated glyph rects instead of whole row spans and are built once per version for all Actors (fonts tex sends 151 -> 91 KB/frame in Studio, TexBytes 35.6 -> 22.2 MB headless); Actor texture handling moved to Raster.ApplyTextures, which Sync mode now runs on per-Actor copies so t_parallel checks it; t_parallel fonts scenario (new size per frame), check_all runs 620 frames 2026-10-20 14:47:54 -05:00
4DBug 19083b757d Faster glyph baking: atlas repack finds RectsIndex entries by the loop index (index_from_ptr was O(n^2) per repack), stb_truetype vertical edges (all of ProggyClean's) without stbtt__handle_clipped_edge calls, FlattenCurves with locals + inlined add_point, @native trunc (sorted-edges 215 -> 107 ms, repack 330 -> 184 ms on bake bench; glyph bitmaps, atlas and draw hashes unchanged) 2026-10-20 14:47:54 -05:00
4DBug c3119740e4 Textures: typed, unrolled RGBA/Alpha8 row conversion (no zero-skip branch): new 512x256 atlas record 0.54 -> 0.30 ms headless, pixels unchanged 2026-10-20 14:47:54 -05:00
4DBug 2ffc355ffe Roblox render: hot loop locals, native DrawLayer, DirtyRects without copies
- CollectPrims / HashTiles / DirtyRects: the Prim* / slot tables as locals (upvalue access per element was
  measurable: Collect -13%, Hash -8%)
- CollectPrims notes flat rects (PrimFlat): HashTiles no longer re-reads uvs, gradient and texture per quad
- HashTiles: one loop over a primitive's tiles instead of nested for loops (most touch one tile)
- DrawLayer, SweepTiles @native (per-tile bookkeeping -33%)
- DirtyRects: clipped bounds computed once (content bounds from them); the tile's Drawn* hash/flat lists are
  swapped with the layer's lists and the bounds with a scratch set instead of copied per entry
Headless full re-collect of the demo vs 0.4.2: Collect -24%, Hash -48%, bookkeeping -32%. Pixels identical
(t_pixels, t_composite, t_parallel, TileLimit run).
2026-10-20 14:47:19 -05:00
4DBug ba9d529935 Roblox render: cheaper CollectPrims + HashTiles (per changed draw list)
HashTiles: a touched tile's count/hashes/lists live in slot arrays for the call (one KeySlot lookup per tile
switch instead of ~7 hash-table reads/writes; consecutive primitives alternate tiles ~40% of the time), the
vertex hash is inlined (HashVertex calls weren't inlined and cost more than the hashing), tile ranges come
from the already-relative bounds. Hash values are unchanged.
CollectPrims: the axis aligned rect test runs before the textured line-quad test (mutually exclusive, so the
result is the same; glyphs no longer read their colours/uvs twice), clipped/limit/extent checks per command
from the command's bounds instead of per primitive, and primitives go to their layer lists while collecting
(no PrimKind pass in DrawLists).
Headless full re-collect of the demo (1500 prims): Collect -10%, Hash -35%.
2026-10-20 14:47:19 -05:00
4DBug b62997f2c3 Roblox backend: faster unchanged check: CompareDrawList compares vertices as 4 f64 + col (3x fewer reads), indices 4 per step; a moved list's snapshot is shifted in place (ShiftSnapshot) instead of re-snapshotted from another list's Cmd* data 2026-10-20 13:56:21 -05:00
4DBug dd9a5ef219 0.4.2
Build & Release / build (push) Canceled after 0s
- Less garbage per frame: scalar text/label sizes, scratch rects/points, reused clip-stack ImVec4 and window stack entries (160 -> 56 KB/frame on demo+stress, draw hashes unchanged)
- Faster glyph baking: @native rasterizer/rect packer/pixel loops, glyph shape cache, comparator-free edge sort, inline scanline conversion, table.create zero-fill; fix leaked global 'step'
- Textures: new atlases convert only the packed corner, flat row conversion skipping zero pixels
- Raster: uniform-region tracking, direct opaque glyph texels, inlined BlendPixel with per-texel cache
- Raster: textured line quads drawn as one quad, u32 texel reads for constant-colour triangles, column walk for tall narrow triangles (plot bench Raster 4.16 -> 3.21 ms, HashVertex 0.64 -> 0.55 ms, pixels unchanged)
- Parallel: send Actors only changed atlas rows / rows above FillRow (full-copy 1283 -> 619 MB on fontbench x4 Actors); dispatch small and text-heavy frames (MinTiles 1, MinPixels 2048, MaxBytesPerPixel 0)
- Stage timing: Textures and Flush stages; parallel stats explain serial flushes
- extensions/: submodules for imcurveedit-luau, imgradient-luau, imgui-memory-editor-luau, imsequencer-luau; all 9 submodule URLs and README links now on GitHub
- new examples: example_love_extensions, example_roblox_extensions
2026-10-17 13:18:53 -05:00
4DBug 9b1052beed 0.4.1
Build & Release / build (push) Canceled after 0s
- TextProxy works for any widget that sets PlatformImeData.WantTextInput (+ SelectedText)
- TextProxy: key-code fallback waits for the TextBox (fixes doubled typing); no stuck Ctrl after paste
- Raster: reversed rects (min > max) draw like upstream (fixes ImNodes/ImPlot box select)
- test harness: --module NAME=path loads extra ModuleScripts
- new tests: t_textproxy_custom, t_rect_flip
- extensions/: submodules for imguicolortextedit-luau, imguizmo-luau, implot-luau, implot3d-luau, imnodes-luau
2026-10-17 07:31:40 -05:00
4DBug b4458195b9 0.4.0
Build & Release / build (push) Canceled after 0s
2026-10-16 22:53:18 -05:00
4DBug 9b735db59c 0.3.0
Build & Release / build (push) Canceled after 0s
2026-10-15 11:04:45 -05:00
4DBug 6fc870a519 CI/releases: drop the nodemo bundles (--no-demo build flag kept); remove examples/example_shared; Roblox backend RenderRate defaults to 60 (0 = every frame); README + TODO.txt updated 2026-10-15 10:57:00 -05:00
4DBug 8f4e07c94a Fix: long TextUnformatted (>2000 bytes) rendered each visible line to the end of the text (RenderText end was nil, upstream passes line_end); PushFont() saved the new font instead of the current one, so PopFont() never restored it (font preview leaked into all later text); t_fixes covers both 2026-10-15 10:54:56 -05:00
4DBug 056c414112 Port leftovers: BringWindowToDisplayBehind, ImGuiSizeCallbackData + CalcWindowSizeAfterConstraint, ErrorCheckUsingSetCursorPosToExtendParentBoundaries, PopFocusScope user error (+ SetCurrentWindow stack sizes fix), log text decorations (Button/Menu/TreeNode/Drag/Slider/InputText/Checkbox/Radio), DataTypeFormatString display, ImGuiDataType S64/U64 (upstream enum layout; doubles), sscanf %u/length modifiers, mouse arrays sized ImGuiMouseButton.COUNT, AddCallback userdata copy; TODO.txt refreshed 2026-10-15 10:51:20 -05:00
4DBug 15485b7aa4 Integration: debug/context fields in ImGuiContext ctor, ImGuiContextHookType, DebugFlashStyleColorIdx=COUNT, CurrentPixelDensity, clipper range/data helpers, full Shutdown cleanup, settings dates (ImGuiSettingsCleanupArgs, CleanupIniSettings, LastUsed=, Platform_SessionDate) + metrics Settings section, ImGuiStyleVar SeparatorSize/DockingSeparatorSize (fixes off-by-one style var table), LogRenderedText restored in RenderText*, combo preview 1.93, InputScalar ValidatedThisFrame, ImGuiListClipperFlags/LogFlags/OldColumnFlags, ImGuiKey digit aliases, backend names 2026-10-15 09:39:17 -05:00
4DBug cdb183da59 compare_upstream: skip IM_MSVC_RUNTIME_CHECKS_*/template<> when naming structs; [=] status for intentional Lua replacements (ImGuiStorage, ImStr*/ImFormatString*, allocators, C++ container internals, sizeof/ABI helpers...) with evidence regexes, reported separately 2026-10-15 09:39:17 -05:00
4DBug df641ad622 Port debug tools (item picker, flash style color, debug locate, DebugDraw*, keyboard preview, debug break, DrawCmd mesh view), context hooks, SetContextName, AddInputCharactersUTF8, sanity checks, window resize ids, Register/UnregisterUserTexture, SetPixelDensity, TestShortcutRouting, DemoMarker; InputTextState selection API (fixes undo crash, callbacks get 0-based positions), ShortcutsForCancel (Esc/right-click reverts drags/sliders), ImParseFormatSanitizeForPrinting, ImDrawList CloneOutput/PrimQuadUV/AddImageQuad, ImDrawData DeIndexAllBuffers/ScaleClipRects, internal helpers (ImBitVector, ImGuiPackedDate, inline ImGui getters...); t_debugtools, t_helpers 2026-10-15 08:52:30 -05:00
4DBug 91931a482b Fonts: ImFontGlyphRangesBuilder + GetGlyphRangesDefault, ImFont:CalcWordWrapPosition, stb_decompress + Decode85 + AddFontFromMemoryCompressed(Base85)TTF, atlas helpers (RemoveFont, RemoveCustomRect, AddRemapCodepoint (remap never triggered before), IsGlyphRangeUnused, texture status/format names...); t_fonts 2026-10-15 08:05:51 -05:00
4DBug c94f62a1e4 Port ImTriangulator + upstream AddConcavePolyFilled (AA fringe, no per-triangle seams); [Luau] handles CCW winding and duplicate/collinear points that upstream mis-triangulates 2026-10-15 07:43:21 -05:00
4DBug 25001b0c8f Library draw call sites match 1.93: AddLineH/AddLineV + StrokeCenterBiased/StrokeInside (window/menu borders, separators, text cursor), tab border PathStroke, check mark AALineEnds, CloseButton/TreeNode lines/ColorButton/alpha checkerboard 1.93, Ctrl+Tab highlight AddRect arg order, metrics AA push/pop 2026-10-15 07:24:13 -05:00
4DBug f875e2b5f7 Draw list 1.93: baked round corners in the font atlas (ImFontAtlasBuildUpdateTexDataCorners, fill radii 1..16 + 3 stroke thicknesses) used by AddRect/AddRectFilled when pixel-aligned (_AddRectBaked/_AddRectFilledBaked) 2026-10-15 06:55:57 -05:00
4DBug 923e6cdafb Draw list 1.93 strokes: _AddPolyline ported (texture AA lines, joins/miter/bevel, CapSquare, AALineEnds, Stroke Inside/Center/CenterBiased/Outside/Legacy), AddConvexPolyFilled AAFill, all primitives with 1.93 signatures/flags, PathRect/PathArcTo 1.93, baked line textures; Custom Rendering demo flags UI restored. check_all: t_pixels incremental==full redraw, headless screenshot (tools/test/shot.py) 2026-10-15 06:37:49 -05:00
4DBug 720daa80d7 Draw list 1.93 foundation (no output change): ImDrawFlags 1.93 values (Round*/Stroke*/AA*/JoinMiter/CapSquare/TextNoPixelSnap/UseTexForRoundCorners...; RoundCorners* kept as obsolete aliases), ImDrawList.Flags + PushDrawFlag/PopDrawFlag/_SetPixelDensity, SetupDrawListSharedData 1.93, style.CurveTessellationMaxError/AntiAliasedLineEnds, _AddPolyline entry point 2026-10-15 05:13:58 -05:00
4DBug 1b618f7230 compare_upstream: match XxxMT:Method and Class_Method globals to C++ class members (demo 100% ported by name) 2026-10-15 04:35:23 -05:00
4DBug ddbfd8fb66 Demo: Selection State & Multi-Select section (ExampleSelectionWithDeletion, ExampleDualListBox, all 11 sub-demos) and Assets Browser ported; fix ImFloor() for negative non-integers (was floor-1) 2026-10-15 04:13:40 -05:00
4DBug 25bc437635 Port multi-select, box-select and typing-select (BeginMultiSelect/EndMultiSelect, SetNextItemSelectionUserData, MultiSelectItemHeader/Footer, BeginBoxSelect/EndBoxSelect, GetTypingSelectRequest/TypingSelectFind*, ImGuiSelectionBasicStorage/ExternalStorage, Metrics nodes); wired into Selectable/Checkbox/TreeNode/clipper/tables; t_multiselect 2026-10-15 03:49:53 -05:00
4DBug d6bdedee85 Fix: InputTextMultiline crashed when drawn (InputTextLineIndexBuild/line offsets 0-based like upstream, inverted buf_display_end), InputText LiveEdit flag check; Shortcut()/IsKeyChordPressed() upstream defaults; FrameCount starts at 0 (IsWindowAppearing on first frame); missing ImGuiIO config fields with upstream defaults (+ ConfigDebugBeginReturnValueOnce/Loop); ColorButton drag source + ColorEdit4 drop target, IMGUI_PAYLOAD_TYPE_COLOR_3F/4F; t_fixes covers them 2026-10-15 03:03:10 -05:00
4DBug 966da7fbcf Demo: re-ported imgui_demo.cpp line by line in upstream order (one function per upstream function, same labels/HelpMarkers/comments, 176/186 IMGUI_DEMO_MARKERs; port table driver/Sub()/Demo* helpers removed, statics in S.<Function>). New: DemoWindowInputs (Inputs & Focus), Image Viewer, ShowExampleAppDockSpaceBasic. Selection/Assets Browser stubbed until multi-select is ported. ImColor helper (imgui_h.lua). PORT_STATUS demo similarity 29% -> 51% 2026-10-15 02:32:58 -05:00
4DBug bc13bc50b8 Fix: ImDrawList:PushClipRectFullScreen() was missing (drop target outside the window clip rect crashed); CalcItemSize() no longer writes to the caller's size (by value like upstream; fixes BeginTable UserOuterSize), scalar _CalcItemSizeXY for internal callers; t_fixes covers both 2026-10-15 02:05:43 -05:00
4DBug ce0f51d9d5 tools/test: check_all.sh (CI mirror + all scripted tests + demo forced open + LÖVE), hashes.sh (draw checksums vs a git rev), t_libhash (library-only draw checksum); regenerate PORT_STATUS 2026-10-15 02:03:40 -05:00
4DBug 7ca140665d 0.2.0
Build & Release / build (push) Canceled after 0s
2026-10-15 01:06:11 -05:00
4DBug 3b28ba362b Roblox backend: redraw budget is opt-in (SetRedrawBudget default 0 = every changed tile drawn the same frame) 2026-10-15 00:55:43 -05:00
4DBug b15bdcd8b6 bundle.py: build-time Luau optimizations (draw-data identical; IMGUI_BUNDLE_NOOPT=1 disables): hot library globals as bundle locals, enum/constant folding (values dumped by the luau CLI; IMGUI_BUNDLE_STRICT=1 in CI), --@hoist pure helpers to inlinable bundle-level local functions, statement IM_ASSERT -> assert; builtin type instead of ImGui._GetTypeFunc() alias (GETGLOBAL 15903 -> 540) 2026-10-15 00:23:20 -05:00