Meta reader: decode every member type the meta files use #422

Manually merged
github merged 2 commits from github-bot/gh-422 into gh-pr/422/base 2026-11-27 02:26:43 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-26 23:04 UTC · original
holdmysocks:claude/meta-types → master · +84 −25 · 3 files · 2 commits · merged 2026-11-27 02:11 UTC

Uses the type table from the schema check in #400, where every file type code is matched to the executable's parser type across all meta files. The codes form families by high nibble:

Family Types
0x0_ bool, struct, pointer, 64-bit id
0x1_ integers
0x2_ half and full floats
0x3_ vectors and matrices
0x4_ strings and hashes
0x5_ arrays
0x6_ enums and bit sets
0x7_ maps

Fixes

  • 0x62 is a 32-bit enum, not a 16-byte tagged value. It now decodes as its number; the old u32 and f32 payloads were the following fields. The three readers of ["tag"] (vehicle colours, the vehicle export, the GUI vehicle table) take the number and still accept older JSON.
  • Bit sets 0x63, 0x64, 0x65 and 0x68 use 8-, 16-, 32- and 64-bit words. 0x65 was read in 64-bit words, so every 0x65 set of 32 bits or fewer had the next field in its top 8 hex digits. A one-word set now prints 8 digits; sets of 33 to 64 bits are unchanged. No reader depends on the width.

New decodes

  • Scalar fields: Meta::scalars now goes through the full decoder for every plain-value type. It used to skip bool, s32, u64, half floats, vec2, matrices, enums, bit sets and strings, so readers that use it (lights, archetypes and others) now get those fields too.
  • New value types: s64 and u64 (0x16, 0x17), the 8-byte vec2 (0x30), mat33v and mat34v (0x35, 0x36), 16-bit enums (0x61), and the string pointers 0x42 and 0x44.
  • Array element sizes: added for the same types.

Checked

  • sixng meta data and meta packs --dump, old build against new, 20,442 resources. Before, the dumps held 5,934 tagged values and 23,494 undecoded values (u64, mat33v, both string types, 8-bit bit sets), plus 25 opaque arrays (u64 and enum elements). After, nothing is undecoded; 38 arrays of arrays (0x5c elements) stay opaque.
  • sixng vehicles packs: the differences are enums as numbers, model names as text, and 32-bit-word bit sets.
  • cargo test -p sixng-core --lib: all pass. The new test is member_types_from_the_parser_tables.
**@⁠holdmysocks** on GitHub · 2026-11-26 23:04 UTC · [original](https://github.com/holdmysocks/SixNG/pull/422) `holdmysocks:claude/meta-types` → `master` · +84 −25 · 3 files · 2 commits · merged 2026-11-27 02:11 UTC Uses the type table from the schema check in #400, where every file type code is matched to the executable's parser type across all meta files. The codes form families by high nibble: | Family | Types | |---|---| | 0x0_ | bool, struct, pointer, 64-bit id | | 0x1_ | integers | | 0x2_ | half and full floats | | 0x3_ | vectors and matrices | | 0x4_ | strings and hashes | | 0x5_ | arrays | | 0x6_ | enums and bit sets | | 0x7_ | maps | **Fixes** - **0x62 is a 32-bit enum**, not a 16-byte tagged value. It now decodes as its number; the old `u32` and `f32` payloads were the following fields. The three readers of `["tag"]` (vehicle colours, the vehicle export, the GUI vehicle table) take the number and still accept older JSON. - **Bit sets 0x63, 0x64, 0x65 and 0x68 use 8-, 16-, 32- and 64-bit words.** 0x65 was read in 64-bit words, so every 0x65 set of 32 bits or fewer had the next field in its top 8 hex digits. A one-word set now prints 8 digits; sets of 33 to 64 bits are unchanged. No reader depends on the width. **New decodes** - **Scalar fields:** `Meta::scalars` now goes through the full decoder for every plain-value type. It used to skip bool, s32, u64, half floats, vec2, matrices, enums, bit sets and strings, so readers that use it (lights, archetypes and others) now get those fields too. - **New value types:** s64 and u64 (0x16, 0x17), the 8-byte vec2 (0x30), mat33v and mat34v (0x35, 0x36), 16-bit enums (0x61), and the string pointers 0x42 and 0x44. - **Array element sizes:** added for the same types. **Checked** - `sixng meta data` and `meta packs --dump`, old build against new, 20,442 resources. Before, the dumps held 5,934 tagged values and 23,494 undecoded values (u64, mat33v, both string types, 8-bit bit sets), plus 25 opaque arrays (u64 and enum elements). After, nothing is undecoded; 38 arrays of arrays (0x5c elements) stay opaque. - `sixng vehicles packs`: the differences are enums as numbers, model names as text, and 32-bit-word bit sets. - `cargo test -p sixng-core --lib`: all pass. The new test is `member_types_from_the_parser_tables`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:39:42 +00:00
# Conflicts:
#	crates/sixng-core/src/meta7a.rs
github-bot changed target branch from master to gh-pr/422/base 2026-11-27 02:26:42 +00:00
github manually merged commit e6acf8fb4f into gh-pr/422/base 2026-11-27 02:26:43 +00:00
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-27 02:27 UTC · original

Downstream check. I built this PR and master at the same commit (master merged in, conflict in the tests resolved) and ran the exports that read through the meta reader with both builds.

Byte-identical:

  • lights levels: sets, world, distant, LOD and timecycle files.
  • pso data: 2,225 files.
  • handling data.
  • materials data.
  • placements levels on 1,027 sampled map files.
  • The people caches head_skins.json, part_skins.json and hair_links.json, rebuilt from scratch with each build.

Also unchanged:

  • vehicles packs: the only differences are 5 lamp_lights colours. Two runs of the master build differ in exactly the same way, so that is existing run-to-run variation, not this PR.

So this PR changes the raw meta --dump / --instances output (enums as numbers, 32-bit-word bit sets, the newly decoded types) and the fields Meta::scalars returns. No current export output changes. Not run: outfit, ped-variations and grooms. They read the same caches as above.

**@⁠holdmysocks** on GitHub · 2026-11-27 02:27 UTC · [original](https://github.com/holdmysocks/SixNG/pull/422#issuecomment-7208142587) **Downstream check.** I built this PR and master at the same commit (master merged in, conflict in the tests resolved) and ran the exports that read through the meta reader with both builds. Byte-identical: - `lights levels`: sets, world, distant, LOD and timecycle files. - `pso data`: 2,225 files. - `handling data`. - `materials data`. - `placements levels` on 1,027 sampled map files. - The people caches `head_skins.json`, `part_skins.json` and `hair_links.json`, rebuilt from scratch with each build. Also unchanged: - `vehicles packs`: the only differences are 5 `lamp_lights` colours. Two runs of the master build differ in exactly the same way, so that is existing run-to-run variation, not this PR. So this PR changes the raw `meta --dump` / `--instances` output (enums as numbers, 32-bit-word bit sets, the newly decoded types) and the fields `Meta::scalars` returns. No current export output changes. Not run: `outfit`, `ped-variations` and `grooms`. They read the same caches as above.
This discussion has been locked. Commenting is limited to contributors.
No description provided.