tests: add edge-case tests for fssm_header wave_size and binding_table #538

Open
github-bot wants to merge 1 commit from github-bot/gh-538 into main AGit
Owner

@⁠kotekompotek on GitHub · 2026-11-24 07:13 UTC · original
kotekompotek:work/test-fssm-header-extra → main · +83 −0 · 1 files · 1 commits · open

Claimed in the coordination issue as: coordination issue #14

What and why

  • Rebased onto current main as a single clean commit adding tests/test_fssm_header_bindings_extra.py without conflicting with tests/test_fssm_header_extra.py on main.
  • Covers fssm_header wave_size and binding_table edge cases.

Tested

  • python -I tests/test_fssm_header_bindings_extra.py passed after rebasing onto current main.

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.
**@⁠kotekompotek** on GitHub · 2026-11-24 07:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/538) `kotekompotek:work/test-fssm-header-extra` → `main` · +83 −0 · 1 files · 1 commits · open Claimed in the coordination issue as: coordination issue #14 ### What and why - Rebased onto current `main` as a single clean commit adding `tests/test_fssm_header_bindings_extra.py` without conflicting with `tests/test_fssm_header_extra.py` on `main`. - Covers `fssm_header` `wave_size` and `binding_table` edge cases. ### Tested - `python -I tests/test_fssm_header_bindings_extra.py` passed after rebasing onto current `main`. 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:07:17 +00:00
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 07:56 UTC · original

Review of head 0d7d996a43b17c49b6e660ce24cad09b036ec481 (AI-assisted, CPU only).

Environment: Linux (WSL2), Python venv with tests/requirements.txt, no GPU.

What ran:

  • python -m pytest -q tests/test_fssm_header_extra.py: 3 passed.
  • Mutated tools/fssm_header.py in a scratch worktree, one at a time; each makes one of the new tests fail:
    • wave_size always returns 64
    • drop the len(blob) < WAVE_FLAGS_OFFSET + 4 check
    • count every interpolant as fp16 (if True: instead of & FLAG_FP16)
    • trailing forced to 0
    • ignore CODE_END_UNSET (if False:)
    • invert the tail filler check

Note: the existing tests/test_fssm_header.py already fails on all six of these mutations, so the new file mostly overlaps what is already covered. The new parts are the short-blob wave_size case, binding_table with CODE_END_UNSET plus trailing bytes, and the fp16 mask over several records. The new file is pytest style (no __main__), while its sibling is unittest. It could go into test_fssm_header.py instead. This is optional.

The branch is based on a main from 2026-11-23, without scripts/run_semantic_tests.py. The PR only adds a test file, so this does not matter.

Not tested: the full suite on this branch, Windows.


Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 07:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/538#issuecomment-7125542174) Review of head 0d7d996a43b17c49b6e660ce24cad09b036ec481 (AI-assisted, CPU only). Environment: Linux (WSL2), Python venv with tests/requirements.txt, no GPU. What ran: - `python -m pytest -q tests/test_fssm_header_extra.py`: 3 passed. - Mutated `tools/fssm_header.py` in a scratch worktree, one at a time; each makes one of the new tests fail: - `wave_size` always returns 64 - drop the `len(blob) < WAVE_FLAGS_OFFSET + 4` check - count every interpolant as fp16 (`if True:` instead of `& FLAG_FP16`) - `trailing` forced to 0 - ignore `CODE_END_UNSET` (`if False:`) - invert the tail filler check Note: the existing `tests/test_fssm_header.py` already fails on all six of these mutations, so the new file mostly overlaps what is already covered. The new parts are the short-blob `wave_size` case, `binding_table` with `CODE_END_UNSET` plus trailing bytes, and the fp16 mask over several records. The new file is pytest style (no `__main__`), while its sibling is unittest. It could go into `test_fssm_header.py` instead. This is optional. The branch is based on a main from 2026-11-23, without `scripts/run_semantic_tests.py`. The PR only adds a test file, so this does not matter. Not tested: the full suite on this branch, Windows. --- _Review written by Claude (Claude Code, Opus 5.5), an AI agent, posted from a contributor's account._
Author
Owner

@⁠kawaii-shakal on GitHub · 2026-11-24 14:48 UTC · original

Re-checked head c45d4e88cd5a94c7429ae33628f6888078b3b86e. Environment: Windows 11, native Python 3.13, no pytest, no GPU.

What ran:

  • python -I tests/test_fssm_header_bindings_extra.py: passes (exit 0).
  • python -I scripts/check_no_game_data.py tests/test_fssm_header_bindings_extra.py: exit 0.
  • Mutations to tools/fssm_header.py, reverted after each run. All four make the new file fail (exit 1): fp16 always counted (if True:), CODE_END_UNSET ignored (if False:), trailing forced to 0, short-blob length check in wave_size dropped.
  • Merges cleanly into current main (f3e26be7c).

Earlier remarks:

  • Missing __main__ block: resolved.
  • Rename: main now has its own tests/test_fssm_header_extra.py (unittest, from 108c24921). Renaming this file to test_fssm_header_bindings_extra.py avoids the add/add conflict.
  • Overlap with existing tests and the suggestion to fold this into test_fssm_header.py (optional): not changed, and not a blocker. Note that test_wave_size_handles_short_non_magic_and_wave32_flag now largely duplicates test_directory_ok_and_wave_size in main's test_fssm_header_extra.py, which checks short blob, wave32 and wave64. The binding_table (CODE_END_UNSET plus trailing bytes) and multi-record fp16 mask tests are still the new parts. The wave_size test could be dropped.

AI-assisted.

**@⁠kawaii-shakal** on GitHub · 2026-11-24 14:48 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/538#issuecomment-7134972748) Re-checked head c45d4e88cd5a94c7429ae33628f6888078b3b86e. Environment: Windows 11, native Python 3.13, no pytest, no GPU. What ran: - `python -I tests/test_fssm_header_bindings_extra.py`: passes (exit 0). - `python -I scripts/check_no_game_data.py tests/test_fssm_header_bindings_extra.py`: exit 0. - Mutations to `tools/fssm_header.py`, reverted after each run. All four make the new file fail (exit 1): fp16 always counted (`if True:`), `CODE_END_UNSET` ignored (`if False:`), `trailing` forced to 0, short-blob length check in `wave_size` dropped. - Merges cleanly into current main (f3e26be7c). Earlier remarks: - Missing `__main__` block: resolved. - Rename: main now has its own `tests/test_fssm_header_extra.py` (unittest, from 108c24921). Renaming this file to `test_fssm_header_bindings_extra.py` avoids the add/add conflict. - Overlap with existing tests and the suggestion to fold this into `test_fssm_header.py` (optional): not changed, and not a blocker. Note that `test_wave_size_handles_short_non_magic_and_wave32_flag` now largely duplicates `test_directory_ok_and_wave_size` in main's `test_fssm_header_extra.py`, which checks short blob, wave32 and wave64. The `binding_table` (CODE_END_UNSET plus trailing bytes) and multi-record fp16 mask tests are still the new parts. The wave_size test could be dropped. AI-assisted.
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 08:58 UTC · original

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

AI-assisted: yes

**@⁠kotekompotek** on GitHub · 2026-11-25 08:58 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/538#issuecomment-7157709511) Rebased on current ubi/main (3f81d46ac), no conflicts. The added tests pass locally on this base (python -I). AI-assisted: yes
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/538/head:github-bot/gh-538'
git switch 'github-bot/gh-538'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-538'
git switch 'github-bot/gh-538'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-538'
git switch 'github-bot/gh-538'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-538'
git switch 'main'
git merge --squash 'github-bot/gh-538'
git switch 'main'
git merge --ff-only 'github-bot/gh-538'
git switch 'main'
git merge 'github-bot/gh-538'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.