runtime: guard null bind callbacks, add owner accessor and unit test suite for DeferredImageBinding (RT-DEFERRED-IMAGE-BINDING-GUARDS-AND-TESTS) #2057
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2057
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/rt-deferred-image-binding-guards-and-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue as: RT-DEFERRED-IMAGE-BINDING-GUARDS-AND-TESTS (claim)
What and why
runtime/src/deferred_image_binding.hsynchronizes deferred single-time image memory binding across concurrent calls (e.g. from command replay and descriptor table creation).Null callback guard:
ensure(): guards against nullbind_function pointer (if (!bind_ || !bind_(owner_)) return false;), returning false safely instead of crashing.Owner query helper:
owner()accessor returningowner_.Unit test suite (
runtime/test/deferred_image_binding_test.cpp):bound() == false,owner() == target).bound() == false).bound_).bound() == true).ensure()simultaneously; callback executes exactly once, all threads succeed).Registers
deferred_image_binding_testand CTest inruntime/CMakeLists.txt.Tested
28/28 checks passed(0 failures).python -I tests/test_ci_registration.py: 16/16 pass.python -I tests/test_text_write_line_endings.py: 3/3 pass.python -I scripts/check_no_game_data.py: clean (0 violations, no game data).AI-assisted (Claude Code)
Verified on Windows 11 (
10.0.26200.9974) with MSVC19.44.35228(x64,/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2) againstmain4a54aedcb+14e1a352c(claim#2570#issuecomment-7238618828):runtime/CMakeLists.txt,runtime/src/deferred_image_binding.h,runtime/test/deferred_image_binding_test.cpp); guards nullbind_callback inDeferredImageBinding::ensure(), addsowner()accessor, and adds a 28-check unit + 16-thread concurrency test target.check_no_game_data.pyclean.4a54aedcb): CallingDeferredImageBinding(&x, nullptr).ensure()onmaincrashes with0xc0000005(STATUS_ACCESS_VIOLATION), and the PR test fails compilation (C2039: 'owner': is not a member of 'leonida::DeferredImageBinding').4a54aedcb+14e1a352cmerge): Auto-merges cleanly (rc=0), compiles with0/W4warnings, anddeferred_image_binding_test.exepasses (Summary: 28 checks, 0 failures,rc=0).AI-assisted.
Run of #2057 (ctest, red/green), by enlight3d. Nothing pushed.
Heads: PR
14e1a352c(base490f5b9ec, older than main), main1bc055e6c.git merge-tree --write-tree main <PR head>is clean (no conflicts).The PR adds
runtime/test/deferred_image_binding_test.cpp(28 checks, registered as ctestdeferred_image_bindinginruntime/CMakeLists.txt) and changesruntime/src/deferred_image_binding.h(a null-callback guard inensure()and a newowner()accessor). Stdlib only, no GPU used.Machine: NVIDIA GeForce RTX 3090 24 GB, driver 621.40, Windows 11 Pro (build 10.0.26300), MSVC 19.44 (VS 2022 Build Tools), CMake + Ninja, RelWithDebInfo.
Commands (vcvars64 environment, only this target built):
deferred_image_bindingPassed (1/1); the executable printsSummary: 28 checks, 0 failures.error C2039: 'owner' is not a member of 'leonida::DeferredImageBinding'(test lines 50 and 94). This one is only "the new member is missing", not behavioural.owner(), revert only the null-callback guard toif (!bind_(owner_)) return false;): the test builds and ctest reports***Exception: SegFault, which is the null callback being called.Link check: merged into main 1bc055e6c, gta6rt.exe builds and links (RelWithDebInfo, MSVC 19.44); no new imports vs main.
Merged after enlight3d (Thib)'s red/green run (RUN, RTX 3090, driver 621.40, Windows 11: green with this PR, red without it, and
gta6rt.exestill links) and a re-check here: no conflict withmain818d881b1, same head as run,no-game-datagreen, and the only ctest failures in the Windows/macOS CI jobs are tests this diff does not touch (known onmainor Vulkan: vk_xdxr_postbuild_readback vk_bindless_dimensions d3d12_compile_pool xbox_present ).AI-assisted (Claude Code, Claude Opus 5.5), merged for MoonEyes.