Skip to content

Converter: preset FG (frame generation) and the FG weight layout - #148

Merged
phantoslayer21 merged 1 commit into
mainfrom
fg/converter-preset
Nov 14, 2026
Merged

phantoslayer21 merged 1 commit into
mainfrom
fg/converter-preset

Conversation

@phantoslayer21

Copy link
Copy Markdown
Owner

Groundwork for converting the frame-generation library's weights (lane h). The spec side's map file is not delivered yet. This PR makes the converter ready to read it, and tests that with synthetic data only.

Converter

  • New preset FG (map version 1 only, "preset": "FG"). Its sources are the frame-generation weight blobs, each its own block source with its own name, length and hashes. The tensors use preset M's record kinds.
  • The sources a version-1/4 map must have are now set per preset (PresetInfo::required_sources). M and L still need W, D and K; FG names none.
  • A map without the "preset" field, loaded with --preset FG, is now read as FG before its sources are checked. Without --preset it is still read as preset M, so the other maps load exactly as before.
  • If the key's blob is missing, the converter exits with code 12 and FG's own message. If any other blob is missing, it exits with code 13 and the log names the blob.

Frame-generation layout (clean/fg/layout.py): the layers of both networks and the size and inner layout of each blob, as structure only. net1 is 17 blobs of [weights][zero area][bias x 16]; net2 is 25 layers, each a weight blob and a bias blob. Tested against the spec side's totals. clean/fg/FORMATS.md lists what is still OPEN: the map file, the axis order inside each blob, the launch order, net1 blob 2 (1x1 or 2x2) and the grid sizes.

Refs #96

Tested

  • Converter ctest, local MSVC + Ninja build: unit, decompression vectors, synthetic (run_tests.py, including the new test_fg) and synthetic5 all pass.
  • test_fg: our own random blobs at the real blob sizes, all 67, in shuffled order at 16-aligned, even and odd offsets, with a decoy. The stand-in map converts, and every tensor and digest matches the independent Python reference. net1's zero area and bias copies 1..15 hold NaN; a map that reads them fails with exit 22, which shows the real conversion skips them. Also tested: --preset FG on a map without the field; FG with --preset L/M and in a version-4 map (both "damaged"); the key's blob missing (exit 12, FG message); another blob missing (exit 13).
  • Unit tests: the preset table (FG allows only version 1, its message, required sources).
  • python -m unittest clean.fg.tests.test_fg_layout (6 tests).

Not tested

  • No real library and no real map: the map is not delivered yet. Conversion of a real file will be checked by digests only, in a later PR.
  • build.sh (GCC/Clang) was not run.

…ces; the FG weight layout

A version-1 map may name "preset": "FG": its sources are the frame-generation
library's weight blobs, each its own block source; the preset requires no source
by name (M and L keep W, D and K). The key's source missing gives FG's own
message (exit 12), any other blob exit 13. --preset FG reads a map without the
field as FG.

clean/fg/layout.py: both networks' layers and blob sizes as structure only,
checked against the spec side's totals. A synthetic end-to-end case converts
our own random blobs in that layout with a stand-in map.

Refs #96

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 05:21
@phantoslayer21
phantoslayer21 merged commit a4c1de3 into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the fg/converter-preset branch November 14, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant