"""vs_layout_census: PAL hardware stage x code markers x VS entry VGPRs, on hand-built containers. python -I tests/test_vs_layout_census.py Every input is built here (index.json, synthetic FSSM payloads in DXBC containers, hand-written .s listings). No game data, no llvm-mc: the one unlisted payload is disassembled by an injected fake. """ import contextlib import io import json import os import struct import subprocess import sys import tempfile import unittest import zlib from unittest import mock ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.join(ROOT, "scripts")) sys.path.insert(0, os.path.join(ROOT, "tools")) import vs_layout_census as V # noqa: E402 TAG = 0x000000C000020000 def fssm(api_id, hardware_id, size=0x300): """A synthetic FSSM header with one PAL stage record.""" data = bytearray(size) data[0:4] = b"FSSM" struct.pack_into("