gdk_runtime_calls: validate table lookup shapes (GDK-TABLE-SHAPE) #1119
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1119"
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?
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-24T18:50:20Z.
Item ID:
GDK-TABLE-SHAPEValidates the JSON structure of GDK class/interface tables in
tools/gdk_runtime_calls.py:RuntimeTable.__init__()before opening or inspecting any PE image.Changes
tools/gdk_runtime_calls.py(RuntimeTable.__init__): Validates that the parsed document is adict, thatclassesandinterfacesaredicts, that each entry is adict, and that every entry'sidis a non-emptystr, raising a descriptiveValueErroron malformed inputs.tests/test_gdk_table_shape.py: Adds synthetic tests covering non-dict roots, non-dictclasses/interfaces, non-dict entries, and missing/empty/non-stringidvalues before PE inspection.Verification
python -I scripts/check_no_game_data.py).Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T18:56:19Z.
Review: APPROVED
Reviewed and verified. Robust validation of
classesandinterfacesJSON dictionary structure intools/gdk_runtime_calls.py:RuntimeTable.__init__. Fails cleanly with descriptiveValueErrorbefore reading PE images. Verified withtests/test_gdk_table_shape.py. 100% clean-room.Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:16:00Z.
Recommendation: [MERGE]
Reasoning:
gdk_runtime_callsvalidates table lookup shapes before using them, with a synthetic test. Tool-only hardening (+11). The description is a one-liner; please give future PRs a fuller description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict withmain. Merge once the queued checks are green.Impact level: 2/10
Imported from ubiquitarianism/leonida. Originally posted by Taffyyy-ops on 2026-11-25T10:44:58Z.
@abnalstlll-byte @Deedlyy Thanks for the review and
[MERGE]recommendation! Updated the PR description with a full summary of theRuntimeTable.__init__shape checks andtests/test_gdk_table_shape.py.Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:49:38Z.
#1119 | head
4a18d32b6e(merged cleanly with mainadfb3821a2) |python -I tests/test_gdk_table_shape.py -v+python -I tests/test_gdk_runtime_calls.py -v+python -I tests/test_gen_gdk_classes_out_dir.py| red on main:FAILED (failures=4, errors=43)(RuntimeTable.__init__crashed with unhandledAttributeError,KeyError, andTypeErroron non-object documents/sections/entries and acceptedNone/empty-stringidfields before proceeding toread_runtime_source) | green on PR+main:3 ran, OK(test_gdk_table_shape.py),25 ran, OK(test_gdk_runtime_calls.py), and1 ran, OK(test_gen_gdk_classes_out_dir.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
4a18d32b6e(tools/gdk_runtime_calls.pyandtests/test_gdk_table_shape.py) on Windows 11 — first execution of this PR — confirmingRuntimeTable.__init__validatesdoc,classes,interfaces, per-entry dicts, and non-empty stringidfields upfront asValueError(caught bymain()before reading the PE image or runtime sources, returning exit code1with no traceback). Also verifiedtests/test_ci_registration.py,tests/test_text_write_line_endings.py, andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T00:43:51Z.
RUN of #1119 (red/green,
python -I, no build, no game, no GPU)Heads tested: PR head
4a18d32b6efc, current main829530dbd019; merged = main + PR head,git merge --no-ff, local only (merged cleanly).Commands, one process each, from the worktree root:
python -I tests/test_gdk_table_shape.pyRelated (they import or run
tools/gdk_runtime_calls.py, or tools that import it):tests/test_gdk_runtime_calls.py,test_gen_gdk_classes_out_dir.py,test_first_look_paths.py,test_first_look_rebuild.py,test_first_look_shim_report.py,test_int3_cause.py,test_json_bom_inputs.py,test_x86_decode_window.py,test_x86_high_byte_writes.py,test_d3d12_device_calls.py,test_exe_checklist.py,test_import_fail_fast.py,test_ci_registration.py,test_text_write_line_endings.py(the ones that exist on the tested tree).tools/gdk_runtime_calls.pywith the PR's new test file):FAILED (failures=4, errors=43)over 3 tests (counted per subtest).RuntimeTable.__init__raisesAttributeError/TypeErroron a non-object document, section or entry, and accepts a missing or emptyid, instead of theValueErrorthe tests expect. The third test (a valid table still works) passes on main, as it should. This is a real red: the tests fail for the reason the PR fixes.test_gdk_table_shape.py3 ran, OK; all related files that exist at that head pass.test_gdk_table_shape.py3 ran, OK; all 14 related files pass. Nothing fails merged that passes on main.Machine: Windows 11 Pro 10.0.26300, CPython 3.13.12, GPU not used.
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:54:19Z.
@Taffyyy-ops this PR is green on
main+ PR (red/green runs posted above by zmasi and enlight3d). The only thing missing for a merge is your claim of its item in the coordination issue #2570. Once it is there, a maintainer can merge it. (This is a one-time note on each of your green PRs: #1115 #1119 #1124 #1136 #1142 #1159.) — OreoFR's agent (AI-assisted)Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:37:40Z.
Merged at head
4a18d32. Tested on this head by enlight3d, zmasi: the new test fails on main and passes with the PR (results in the comments above). AI-assisted: yes.