Use len(draw_data.cmd_lists) in imgui backend - #830
Merged
Conversation
hmaarrfk
added a commit
to conda-forge-admin/wgpu-py-feedstock
that referenced
this pull request
Aug 18, 2026
<details><summary>Claude's draft</summary> imgui-bundle 1.92.900 removed `ImDrawData.cmd_lists_count`, a legacy alias documented as `== CmdLists.Size`. Against that release every `ImguiWgpuBackend.render()` call in wgpu 0.32.0 raises AttributeError. Backport the one-line source change from pygfx/wgpu-py#830 (commit 495a413), which uses `len(draw_data.cmd_lists)` instead — exactly what the removed attribute equalled, and valid across the whole supported `imgui-bundle>=1.92.0,<2` range, so no pin change is needed. The upstream CHANGELOG, CI workflow and new test file are not relevant to the package and are not included. Verified the patch applies to the wgpu-0.32.0 PyPI sdist with both `patch -p1 --dry-run` and `git apply --check -p1`. Bump the build number to 1: 0.32.0 build 0 is already published on conda-forge, so the repackaged content needs a new build. Resume this Claude session: ``` cd /home/mark/git/feedstocks claude --resume 5ef2cc50-a932-469f-af39-981f03b34d85 ``` </details>
<details><summary>Claude's draft</summary> test_examples_run() ran an example's __main__ block and stopped there. Under the offscreen canvas that only constructs the canvas and registers a draw function, so nothing is drawn and the draw function -- the bulk of most examples -- was never executed. Draw one frame for every example that exposes a canvas. Drawing is not enough on its own: rendercanvas calls the draw function inside its log_exception() context, so an exception there is logged to the "rendercanvas" logger and swallowed, and a frame still comes out. Assert that nothing was logged there. This makes the imgui examples fail against imgui_bundle 1.92.900, which is the bug reported in pygfx#829 and is fixed in the next commit. Resume this Claude session: ``` cd /home/mark/git/wgpu-py claude --resume 590dd7bc-312c-419e-ad3d-2c69d00943cd ``` </details>
<details><summary>Claude's draft</summary> `ImDrawData.cmd_lists_count` was a legacy alias, documented in the imgui_bundle stubs as `== CmdLists.Size`, and imgui_bundle removed it in 1.92.900. Every `ImguiWgpuBackend.render()` call raises AttributeError against that release. Fixes pygfx#829. `len(draw_data.cmd_lists)` is exactly what the removed attribute equalled, and works across the whole supported `imgui-bundle>=1.92.0,<2` range: verified against 1.92.0, 1.92.3, 1.92.4, 1.92.5, 1.92.600, 1.92.601, 1.92.700, 1.92.801 and 1.92.900. No shim or version check is needed, and the pin does not need narrowing. The test from the previous commit fails without this change and passes with it. Resume this Claude session: ``` cd /home/mark/git/wgpu-py claude --resume 590dd7bc-312c-419e-ad3d-2c69d00943cd ``` </details>
hmaarrfk
force-pushed
the
fix-imgui-cmd-lists-count
branch
from
August 19, 2026 01:49
fb2f641 to
461e941
Compare
10 tasks
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.
closes #829
see failing tests in #831
stays compatible with 1.19.X
Claude's draft
ImDrawData.cmd_lists_countwas a legacy alias documented as== CmdLists.Size, and imgui_bundle removed it in 1.92.900. EveryImguiWgpuBackend.render()call now raises AttributeError against that release. Fixes #829.len(draw_data.cmd_lists)is exactly what the removed attribute equalled and works on all releases in the supportedimgui-bundle>=1.92.0,<2range, verified against 1.92.0, 1.92.3, 1.92.4, 1.92.5, 1.92.600, 1.92.601, 1.92.700, 1.92.801 and 1.92.900. No shim or version check is needed, and the pin does not need narrowing.Add tests/test_util_imgui.py, which renders one real frame through ImguiRenderer on an offscreen canvas. The existing example tests never enter the backend's render() (the offscreen canvas does not pump a draw), so they pass even with the bug present. The "Test Examples" job is the only CI job that installs imgui_bundle, so it now runs that test file too; adding imgui-bundle to the
testsextra was rejected because that extra is used by the 3.14 and pypy3.11 matrix jobs.Resume this Claude session: