BUILD-GAMEDATA-GRAPH-INDEX-AND-ATOMIC: gamedata_graph: index sibling parentPath lookups and write JSON atomically #897
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!897
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/897/head"
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?
@narekshaghoyandev on GitHub · 2026-11-24 15:02 UTC · original
narekshaghoyandev:ubiq-gamedata-graph-index-and-atomic→main· +87 −6 · 2 files · 1 commits · merged 2026-11-24 23:22 UTCImproves
tools/gamedata_graph.pyperformance and JSON report safety with identical graph output:resolve_parent_paths: Lazily indexes siblings by(id(container), tag, attribute) -> {value: [siblings]}instead of scanning every sibling perparentPathelement (O(N^2) o O(N)), preserving exact resolved/ambiguous counts and link order.write_json,main): Publishes--jsonviatempfile.mkstemp+file_mode.published_mode+replace_retry.replacewithallow_nan=False, trailing LF, and read-only-safe temp cleanup on failure (preserving existing reports and permissions). Also accepts optionalargv=Noneinmain(argv=None).Verification
python3 -I tests/test_gamedata_graph.py -v: 21/21 pass (negative control fails onmain).python3 -I scripts/check_no_game_data.py tools/gamedata_graph.py tests/test_gamedata_graph.py: clean.python3 -m compileall -q tools/gamedata_graph.py tests/test_gamedata_graph.py: clean.Claimed in the coordination issue as: BUILD-GAMEDATA-GRAPH-INDEX-AND-ATOMIC (#14)
AI-assisted: yes (Gemini)
@KernelSmoker on GitHub · 2026-11-24 15:06 UTC · original · approved these changes
Reviewed exact head
755283da5980158eac5a6817e2e29340c85bd8d3. The sibling lookup index is keyed by container/tag/attribute and preserves duplicate matches (so ambiguity behavior remains intact); synthetic 2,000/4,000/8,000 sibling chains resolved all expected links with no ambiguity. Atomic JSON output preserves the previous file on replace failure, cleans its temporary file, preserves existing permissions, and writes the trailing LF. Validation on Bazzite/Linux:python3 -I tests/test_gamedata_graph.py -v(19/19 passed), isolated Python compile andgit diff --checkpassed. No game data or GPU used.@LewisStephens99 on GitHub · 2026-11-24 15:13 UTC · original
Independent verification on Windows 11, Python 3.14:
n-python -I tests/test_gamedata_graph.py: 21/21 passed.n- No game data or GPU used. AI-assisted.@QemmHD on GitHub · 2026-11-24 23:22 UTC · original
Merging.
Why merged: BUILD-GAMEDATA-GRAPH-INDEX-AND-ATOMIC: gamedata_graph builds an index of sibling parentPath lookups (O(N) instead of O(N²)), keeping duplicate matches so ambiguity is still detected. It also catches RecursionError and writes --json atomically (mkstemp + replace_retry + published_mode). KernelSmoker approved it, and LewisStephens99 got 21/21 on Windows.
Why it's good: 26 passed. The JSON now uses allow_nan=False, which is harmless because the graph holds only counts.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main
0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.AI-assisted (Claude Code, Claude Opus 5.5).