Skip to main content

Module fuzz

Module fuzz 

Source
Expand description

The fuzz targets’ input layouts (fuzz/, the fuzz plan of docs/plans/core.md section 6), in one place: the targets read their inputs through these, and the seed command (examples/fuzz_seeds.rs) writes the builders’ files, trees, objects and blocks through them, so the two cannot drift.

  • TreeCase: a typetree and the bytes of one value, for the targets that read and write values (boost_read, python_read, write_after_read). The rows are what the readers and the tree compiler read of a node (level, meta flag, type, name), so a mutation of a type name or a level is one byte away, not an offset into a string buffer.
  • blob_case: a stored typetree, the bytes TypeTreeNode.parse_blob or TypeTreeNode.parse read, for the typetree target.
  • lz4_case: one LZ4 block and its declared size, for the lz4 target.
  • TextureCase: a Texture2D’s fields, the meter its decode runs under and its data, for the texture target.
  • MeshCase: a Mesh’s or a Sprite’s value, its file’s version and byte order, its resource and the meter, for the meshdecode target.
  • ShaderCase: a shader program blob, its Unity version and the meter, for the shader target.
  • anim_humanoid_cases: SceneCase humanoid rigs, for the anim_humanoid target.

Every decoder here takes any bytes: a field the input does not reach is empty (a row, a reference, the data), never an error.

Structs§

MeshCase
A Mesh’s or a Sprite’s value, the version and byte order its file has, the bytes its m_StreamData reads and the meter, for the meshdecode target (unityrs-meshdecode’s MeshHandler).
RefType
A ref type: its class, namespace and assembly, and its tree, if stored.
Row
A typetree row: what the readers and the compiler read of a node.
SceneCase
A synthetic serialized scene and strict export profile for the 3D targets. Layout: meter and flags (one byte each), a little-endian u16 profile length, that many profile bytes, then the serialized file to the end. Flag 1 selects a prefab graph, flag 2 the CorePbr mapper. Nonzero meters also run the export under meter² × 64 bytes.
ShaderCase
A shader program blob and the Unity version selecting its entry table.
TextureCase
A Texture2D’s fields, the meter its decode runs under and its data, for the texture target (unityrs-texture’s select and decode).
TreeCase
A tree, the ref types it may reach, and the bytes of one value.

Functions§

anim_clip_cases
anim_clip cases: every animated scene, alone and in a bundle, as a scene (flags 0) and as a prefab sampled on the clip’s own schedule with filtered renderers (flags 7), at meters 0, 1, 16 and 64.
anim_gltf_cases
anim_gltf cases: every animated scene under all-discovered (with and without a sample-rate override) and explicit clip selection, at meters 0, 1, 16 and 64.
anim_humanoid_cases
anim_humanoid cases: every rig and clip variant, alone and in a bundle, as a scene with the controller’s clips only (flags 0) and as a prefab with every rig against every humanoid clip of the file (flags 3), at meters 0, 1, 16 and 64.
blob_case
The typetree target’s input: the format (a byte), a byte whose low bit says big-endian, then the stored tree.
lz4_case
The lz4 target’s input: the declared size (a u32, little-endian), then the block.
scene_cases
All three supported version layouts, renderers, materials, and hostile links. The generated bytes are never checked into the repository.