[PR #885] OLD-7648: glb_skinning: bound bufferView-less zero accessors and write JSON reports atomically #923

Open
opened 2026-11-26 20:19:30 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/885
Author: @narekshaghoyandev
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: ubiq-glb-skinning-zero-accessor-and-atomic-write


📝 Commits (1)

  • 372bac6 glb_skinning: bound bufferView-less zero accessors and write JSON reports atomically

📊 Changes

2 files changed (+78 additions, -8 deletions)

View changed files

📝 tests/test_glb_skinning.py (+43 -0)
📝 tools/glb_skinning.py (+35 -8)

📄 Description

Reopening my original upstream PR #7648 (previously verified on Linux and macOS M1 by @slint6614-dev and @azterixx), cleanly rebased onto main:

  1. Bound zero-initialized accessors without bufferView (_Reader.read): Rejects bufferView-less accessors with count > MAX_ZERO_ACCESSOR_COUNT (1_000_000) as GlbSkinError instead of attempting unbounded list allocation (OOM), and reuses a single immutable zero tuple per accessor ([(zero,) * components] * count).
  2. Atomic JSON report writes & --json directory guard (write_json, main): Writes --json reports via tempfile.mkstemp + file_mode.published_mode + replace_retry.replace (preserving permissions and leaving any existing report intact on write/replace failure, with read-only-safe temp cleanup), and refuses --json <directory> before reading the GLB with exit code 2.

Verification

  • python3 -I tests/test_glb_skinning.py -v: 28/28 pass (both new tests fail/error against main).
  • python3 -I scripts/check_no_game_data.py tools/glb_skinning.py tests/test_glb_skinning.py: clean.
  • python3 -m compileall -q tools/glb_skinning.py tests/test_glb_skinning.py: clean.

Claimed in the coordination issue as: OLD-7648 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135149126)
AI-assisted: yes (Gemini)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/885 **Author:** [@narekshaghoyandev](https://github.com/narekshaghoyandev) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ubiq-glb-skinning-zero-accessor-and-atomic-write` --- ### 📝 Commits (1) - [`372bac6`](https://github.com/ubiquitarianism/leonida/commit/372bac60d726670a1b2b52fd74a9bbcf2028f66a) glb_skinning: bound bufferView-less zero accessors and write JSON reports atomically ### 📊 Changes **2 files changed** (+78 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_glb_skinning.py` (+43 -0) 📝 `tools/glb_skinning.py` (+35 -8) </details> ### 📄 Description Reopening my original upstream PR #7648 (previously verified on Linux and macOS M1 by `@slint6614-dev` and `@azterixx`), cleanly rebased onto `main`: 1. **Bound zero-initialized accessors without `bufferView` (`_Reader.read`)**: Rejects `bufferView`-less accessors with `count > MAX_ZERO_ACCESSOR_COUNT` (`1_000_000`) as `GlbSkinError` instead of attempting unbounded list allocation (`OOM`), and reuses a single immutable zero tuple per accessor (`[(zero,) * components] * count`). 2. **Atomic JSON report writes & `--json` directory guard (`write_json`, `main`)**: Writes `--json` reports via `tempfile.mkstemp` + `file_mode.published_mode` + `replace_retry.replace` (preserving permissions and leaving any existing report intact on write/replace failure, with read-only-safe temp cleanup), and refuses `--json <directory>` before reading the GLB with exit code 2. ### Verification - `python3 -I tests/test_glb_skinning.py -v`: 28/28 pass (both new tests fail/error against `main`). - `python3 -I scripts/check_no_game_data.py tools/glb_skinning.py tests/test_glb_skinning.py`: clean. - `python3 -m compileall -q tools/glb_skinning.py tests/test_glb_skinning.py`: clean. Claimed in the coordination issue as: OLD-7648 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135149126) AI-assisted: yes (Gemini) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#923
No description provided.