tools: guard malformed gfx_off and bool vertex_count in skinned GLB export #258

Merged
leonida/mandy
kotekompotek merged 1 commit from work/build-1532-skinned-glb into main 2026-11-28 18:51:57 +00:00

Pull request successfully merged and closed

kotekompotek commented 2026-11-24 02:54:22 +00:00

Claimed in the coordination issue as: BUILD-1532 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149)

What and why

  • Rebased onto current main and squashed into one clean commit (691c178e2).
  • Reject bool vertex_count and malformed ("", bool, float, inf) gfx_off cleanly with SkinError in tools/skinned_glb.py, while preserving gfx_off=None / absent defaulting to 0.
  • Added regression tests (test_malformed_gfx_off_and_none_default, test_bool_vertex_count_is_rejected) in tests/test_skinned_glb.py.

Tested

  • python -I tests/test_skinned_glb.py (32 tests OK) on commit 691c178e2.
  • All 12 tests/test_docs_*.py (OK) on commit 691c178e2.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.
Claimed in the coordination issue as: BUILD-1532 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140050149) ### What and why - Rebased onto current `main` and squashed into one clean commit (`691c178e2`). - Reject `bool` `vertex_count` and malformed (`""`, `bool`, `float`, `inf`) `gfx_off` cleanly with `SkinError` in `tools/skinned_glb.py`, while preserving `gfx_off=None` / absent defaulting to `0`. - Added regression tests (`test_malformed_gfx_off_and_none_default`, `test_bool_vertex_count_is_rejected`) in `tests/test_skinned_glb.py`. ### Tested - `python -I tests/test_skinned_glb.py` (`32 tests OK`) on commit `691c178e2`. - All 12 `tests/test_docs_*.py` (`OK`) on commit `691c178e2`. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed.
ubiquitarianism commented 2026-11-24 03:14:43 +00:00

Not merging yet. The malformed-gfx_off crash does reproduce (gfx_off: "abc" gives a ValueError traceback). Please:

  • add tests to tests/test_skinned_glb.py for a bad gfx_off and a bool vertex_count; the description mentions regression coverage, but the diff has none;
  • fix the title: the diff doesn't change skinning weights;
  • say whether rejecting "" and False for gfx_off is intended. Main accepted both as 0.
Not merging yet. The malformed-`gfx_off` crash does reproduce (`gfx_off: "abc"` gives a ValueError traceback). Please: - add tests to `tests/test_skinned_glb.py` for a bad `gfx_off` and a bool `vertex_count`; the description mentions regression coverage, but the diff has none; - fix the title: the diff doesn't change skinning weights; - say whether rejecting `""` and `False` for `gfx_off` is intended. Main accepted both as 0.
kotekompotek commented 2026-11-24 18:32:35 +00:00

@ubiquitarianism Updated in commit 691c178e2:

  • Added regression tests (test_malformed_gfx_off_and_none_default, test_bool_vertex_count_is_rejected) in tests/test_skinned_glb.py.
  • Rewrote commit and PR title to drop the inaccurate "skinning weights" reference.
  • Confirmed gfx_off=None/absent still defaults to 0, while malformed values ("", bool, float) for gfx_off and bool for vertex_count are rejected intentionally.

Verified: python -I tests/test_skinned_glb.py (32 tests OK) and all 12 tests/test_docs_*.py (OK).

@ubiquitarianism Updated in commit `691c178e2`: - Added regression tests (`test_malformed_gfx_off_and_none_default`, `test_bool_vertex_count_is_rejected`) in `tests/test_skinned_glb.py`. - Rewrote commit and PR title to drop the inaccurate "skinning weights" reference. - Confirmed `gfx_off=None`/absent still defaults to `0`, while malformed values (`""`, `bool`, `float`) for `gfx_off` and `bool` for `vertex_count` are rejected intentionally. Verified: `python -I tests/test_skinned_glb.py` (32 tests OK) and all 12 `tests/test_docs_*.py` (OK).
kotekompotek commented 2026-11-25 08:58:00 +00:00

Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I).

AI-assisted: yes

Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes
MoonEyes commented 2026-11-28 18:51:53 +00:00

Red/green: tests/test_skinned_glb.py fails on main (7 failures and 2 errors: ValueError on gfx_off='abc', OverflowError on inf, bool vertex_count accepted) and passes with the PR merged, on GitHub Actions Linux and natively on Windows.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: tests/test_skinned_glb.py fails on main (7 failures and 2 errors: ValueError on gfx_off='abc', OverflowError on inf, bool vertex_count accepted) and passes with the PR merged, on GitHub Actions Linux and natively on Windows. Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main 7daa4a4a5 in GitHub Actions: no new failure. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.