{
  "schema_version": "zinc-zig-api-v1",
  "title": "ZINC Zig API",
  "description": "Primary generated reference for the ZINC Zig runtime and supporting Vulkan compute modules.",
  "site": "https://zolotukhin.ai",
  "root_url": "https://zolotukhin.ai/zinc/docs/zig-api",
  "json_url": "https://zolotukhin.ai/zinc/docs/zig-api.json",
  "text_url": "https://zolotukhin.ai/zinc/docs/zig-api.txt",
  "llms_url": "https://zolotukhin.ai/llms.txt",
  "generated_at": "2026-07-19",
  "last_updated": "2026-07-19",
  "counts": {
    "sections": 16,
    "modules": 93,
    "code_lines": 119020,
    "exports": 654,
    "methods": 476,
    "symbols": 1130
  },
  "sections": [
    {
      "slug": "cli-entrypoints",
      "title": "CLI & Entrypoints",
      "description": "Startup, argument parsing, and the top-level process path that wires model loading, tokenization, and generation together.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#cli-entrypoints",
      "module_count": 4,
      "symbol_count": 16,
      "modules": [
        {
          "slug": "build-info",
          "title": "Build Info",
          "section": "CLI & Entrypoints",
          "summary": "Build metadata exported by `build.zig` for CLI version reporting.",
          "overview": [
            "The values in this module are generated at compile time from build options such as `-Dversion` and `-Dcommit`, then printed by `zinc --version`."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/",
          "source_path": "src/build_info.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L10",
          "counts": {
            "code_lines": 30,
            "exports": 6,
            "methods": 0,
            "symbols": 6
          },
          "symbols": [
            {
              "name": "version",
              "qualified_name": "version",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const version = build_options.version",
              "anchor": "version",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#version",
              "source_path": "src/build_info.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L10",
              "doc": {
                "summary": "Semantic version string for this build (from `-Dversion`, e.g.",
                "description": [
                  "`0.3.1`)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Semantic version string for this build (from `-Dversion`, e.g. `0.3.1`)."
              },
              "members": []
            },
            {
              "name": "commit",
              "qualified_name": "commit",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const commit = build_options.commit",
              "anchor": "commit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#commit",
              "source_path": "src/build_info.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L12",
              "doc": {
                "summary": "Short git commit hash this binary was built from (from `-Dcommit`).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Short git commit hash this binary was built from (from `-Dcommit`)."
              },
              "members": []
            },
            {
              "name": "target",
              "qualified_name": "target",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const target = build_options.target",
              "anchor": "target",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#target",
              "source_path": "src/build_info.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L14",
              "doc": {
                "summary": "Compilation target triple this binary was built for (from `-Dtarget`).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Compilation target triple this binary was built for (from `-Dtarget`)."
              },
              "members": []
            },
            {
              "name": "optimize",
              "qualified_name": "optimize",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const optimize = build_options.optimize",
              "anchor": "optimize",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#optimize",
              "source_path": "src/build_info.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L16",
              "doc": {
                "summary": "Active optimize mode, e.g.",
                "description": [
                  "`ReleaseFast` or `Debug` (from `-Doptimize`)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Active optimize mode, e.g. `ReleaseFast` or `Debug` (from `-Doptimize`)."
              },
              "members": []
            },
            {
              "name": "backend",
              "qualified_name": "backend",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const backend = build_options.backend",
              "anchor": "backend",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#backend",
              "source_path": "src/build_info.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L18",
              "doc": {
                "summary": "GPU backend(s) compiled into this binary, e.g.",
                "description": [
                  "`vulkan` or `metal`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GPU backend(s) compiled into this binary, e.g. `vulkan` or `metal`."
              },
              "members": []
            },
            {
              "name": "writeVersion",
              "qualified_name": "writeVersion",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn writeVersion(writer: anytype) !void",
              "anchor": "write-version",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/build-info/#write-version",
              "source_path": "src/build_info.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/build_info.zig#L26",
              "doc": {
                "summary": "Write the full `zinc --version` report to `writer`.",
                "description": [
                  "Emits the version, commit, target, optimize mode, and compiled-in backends, each on its own line."
                ],
                "params": [
                  {
                    "name": "writer",
                    "description": "Destination writer that receives the formatted metadata block."
                  }
                ],
                "returns": "Propagates only the writer's own error if printing fails.",
                "notes": [],
                "raw": "Write the full `zinc --version` report to `writer`.\n\nEmits the version, commit, target, optimize mode, and compiled-in backends,\neach on its own line."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "main",
          "title": "CLI",
          "section": "CLI & Entrypoints",
          "summary": "CLI entrypoints for configuring ZINC and starting local inference.",
          "overview": [
            "This module wires together GPU initialization, model loading, tokenization, and the single-process decode loop used for prompt-mode execution."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/",
          "source_path": "src/main.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L69",
          "counts": {
            "code_lines": 2747,
            "exports": 7,
            "methods": 0,
            "symbols": 7
          },
          "symbols": [
            {
              "name": "is_debug_mode",
              "qualified_name": "is_debug_mode",
              "declaration_kind": "var",
              "kind": "variable",
              "signature": "pub var is_debug_mode: bool = false",
              "anchor": "is-debug-mode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#is-debug-mode",
              "source_path": "src/main.zig",
              "source_line": 69,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L69",
              "doc": {
                "summary": "Global flag enabling verbose debug log output when `--debug` is passed or the `ZINC_DEBUG` env var is set.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Global flag enabling verbose debug log output when `--debug` is passed or the `ZINC_DEBUG` env var is set."
              },
              "members": []
            },
            {
              "name": "std_options",
              "qualified_name": "std_options",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const std_options = std.Options{",
              "anchor": "std-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#std-options",
              "source_path": "src/main.zig",
              "source_line": 72,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L72",
              "doc": {
                "summary": "Zig standard library options — sets log level to debug and wires the custom log function.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Zig standard library options — sets log level to debug and wires the custom log function."
              },
              "members": []
            },
            {
              "name": "myLogFn",
              "qualified_name": "myLogFn",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn myLogFn( comptime level: std.log.Level, comptime scope: @TypeOf(.enum_literal), comptime format: []const u8, args: anytype, ) void",
              "anchor": "my-log-fn",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#my-log-fn",
              "source_path": "src/main.zig",
              "source_line": 82,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L82",
              "doc": {
                "summary": "Custom log handler that filters debug messages unless `is_debug_mode` is set.",
                "description": [],
                "params": [
                  {
                    "name": "level",
                    "description": "Severity level; debug messages are suppressed when `is_debug_mode` is false."
                  },
                  {
                    "name": "scope",
                    "description": "Call-site scope tag; displayed as `(<scope>):` or `: ` for the default scope."
                  },
                  {
                    "name": "format",
                    "description": "Comptime format string passed through to `std.debug.print`."
                  },
                  {
                    "name": "args",
                    "description": "Runtime arguments matched to `format`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Custom log handler that filters debug messages unless `is_debug_mode` is set."
              },
              "members": []
            },
            {
              "name": "Config",
              "qualified_name": "Config",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Config = struct",
              "anchor": "config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#config",
              "source_path": "src/main.zig",
              "source_line": 164,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L164",
              "doc": {
                "summary": "Runtime configuration built from CLI flags and default values.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime configuration built from CLI flags and default values."
              },
              "members": []
            },
            {
              "name": "Command",
              "qualified_name": "Command",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Command = enum",
              "anchor": "command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#command",
              "source_path": "src/main.zig",
              "source_line": 227,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L227",
              "doc": {
                "summary": "Top-level CLI subcommands parsed from argv.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Top-level CLI subcommands parsed from argv."
              },
              "members": []
            },
            {
              "name": "parseArgs",
              "qualified_name": "parseArgs",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseArgs(args: []const [:0]const u8) !Config",
              "anchor": "parse-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#parse-args",
              "source_path": "src/main.zig",
              "source_line": 552,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L552",
              "doc": {
                "summary": "Parse the process argument vector into a validated runtime configuration.",
                "description": [],
                "params": [
                  {
                    "name": "args",
                    "description": "Raw argv slice, including argv[0]."
                  }
                ],
                "returns": "A populated Config value or a validation error describing the first invalid flag.",
                "notes": [],
                "raw": "Parse the process argument vector into a validated runtime configuration."
              },
              "members": []
            },
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#main",
              "source_path": "src/main.zig",
              "source_line": 2326,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/main.zig#L2326",
              "doc": {
                "summary": "Parse arguments, dispatch model-management commands, run diagnostics, or start inference.",
                "description": [
                  "In prompt mode the engine runs up to `max_tokens` forward passes and prints the decoded output. In server mode an HTTP listener is started and requests are handled until SIGINT/SIGTERM."
                ],
                "params": [],
                "returns": null,
                "notes": [
                  "Fatal startup errors are logged and the process exits rather than returning an error."
                ],
                "raw": "Parse arguments, dispatch model-management commands, run diagnostics, or start inference.\nIn prompt mode the engine runs up to `max_tokens` forward passes and prints the decoded output.\nIn server mode an HTTP listener is started and requests are handled until SIGINT/SIGTERM."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "zig-struct-analyzer",
          "title": "Zig-struct-analyzer",
          "section": "CLI & Entrypoints",
          "summary": "Generated struct-layout probe used by the site Zig API docs.",
          "overview": [
            "The docs build emits a temporary Zig file that imports selected public structs and prints their size, alignment, and field offsets; this runner simply dispatches to that generated probe."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/zig-struct-analyzer/",
          "source_path": "src/zig-struct-analyzer.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zig-struct-analyzer.zig#L10",
          "counts": {
            "code_lines": 4,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/zig-struct-analyzer/#main",
              "source_path": "src/zig-struct-analyzer.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zig-struct-analyzer.zig#L10",
              "doc": {
                "summary": "Run the generated struct-layout probe used by the site Zig API docs build.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Run the generated struct-layout probe used by the site Zig API docs build."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "main",
          "title": "CLI",
          "section": "CLI & Entrypoints",
          "summary": "ZINC_RT backend entrypoint.",
          "overview": [
            "The M0 binary is intentionally small: it brings up tier selection and the T-CPU packet runner without linking the Vulkan backend. Pass `--prompt` to drive the host-assisted forward path, or `--probe-tier` to report tier admission status without running a model. The tenant-aware batch planner lives in `zinc_rt.batching`; the CLI does not yet expose the HTTP server or end-to-end batched inference executor."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/",
          "source_path": "src/zinc_rt/main.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/main.zig#L19",
          "counts": {
            "code_lines": 568,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "std_options",
              "qualified_name": "std_options",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const std_options = std.Options{",
              "anchor": "std-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#std-options",
              "source_path": "src/zinc_rt/main.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/main.zig#L19",
              "doc": {
                "summary": "Zig standard library log configuration for the zinc_rt binary.",
                "description": [
                  "Lowering this to `.debug` keeps the M0 trace prints visible without an extra build flag; the engine itself respects `ZINC_RT_LOG_LEVEL`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Zig standard library log configuration for the zinc_rt binary.\nLowering this to `.debug` keeps the M0 trace prints visible without an\nextra build flag; the engine itself respects `ZINC_RT_LOG_LEVEL`."
              },
              "members": []
            },
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/main/#main",
              "source_path": "src/zinc_rt/main.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/main.zig#L38",
              "doc": {
                "summary": "Process entrypoint for the `zinc` binary built with `-Dbackend=zinc_rt`.",
                "description": [
                  "Parses CLI flags, selects the runtime tier from `ZINC_RT_TIER`, and dispatches to the help, probe, prompt, or T-CPU smoke path. with status 1 on argument or tier-parse failures."
                ],
                "params": [],
                "returns": "Propagates any allocation, argument, or runtime error; exits",
                "notes": [],
                "raw": "Process entrypoint for the `zinc` binary built with `-Dbackend=zinc_rt`.\nParses CLI flags, selects the runtime tier from `ZINC_RT_TIER`, and\ndispatches to the help, probe, prompt, or T-CPU smoke path.\nwith status 1 on argument or tier-parse failures."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "model-format-loading",
      "title": "Model Format & Loading",
      "description": "GGUF parsing, metadata normalization, and the runtime structures that move weights from disk into GPU-resident buffers.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#model-format-loading",
      "module_count": 5,
      "symbol_count": 59,
      "modules": [
        {
          "slug": "config",
          "title": "Config",
          "section": "Model Format & Loading",
          "summary": "Platform-independent model types shared by Vulkan and Metal backends.",
          "overview": [
            "The actual extraction logic lives in loader.zig (Vulkan) and loader_metal.zig (Metal). Both share this config type for GGUF parsing, but keep separate loaders because loader.zig has Vulkan imports at the top level."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/config/",
          "source_path": "src/model/config.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/config.zig#L13",
          "counts": {
            "code_lines": 94,
            "exports": 3,
            "methods": 0,
            "symbols": 3
          },
          "symbols": [
            {
              "name": "Architecture",
              "qualified_name": "Architecture",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Architecture = enum",
              "anchor": "architecture",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/config/#architecture",
              "source_path": "src/model/config.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/config.zig#L13",
              "doc": {
                "summary": "Supported model families inferred from GGUF architecture metadata.",
                "description": [
                  "Multiple GGUF architecture strings may collapse to a single variant — for example `\"llama\"` maps to `.mistral` and `\"qwen3\"` maps to `.qwen2` because their forward-pass implementations are identical. `.unknown` is returned for any unrecognised string."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Supported model families inferred from GGUF architecture metadata.\nMultiple GGUF architecture strings may collapse to a single variant —\nfor example `\"llama\"` maps to `.mistral` and `\"qwen3\"` maps to `.qwen2`\nbecause their forward-pass implementations are identical.\n`.unknown` is returned for any unrecognised string."
              },
              "members": []
            },
            {
              "name": "ModelConfig",
              "qualified_name": "ModelConfig",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelConfig = struct",
              "anchor": "model-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/config/#model-config",
              "source_path": "src/model/config.zig",
              "source_line": 30,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/config.zig#L30",
              "doc": {
                "summary": "Normalized model dimensions and routing metadata extracted from GGUF fields.",
                "description": [
                  "SSM-specific fields (`ssm_d_*`, `ssm_n_group`, `full_attn_interval`) default to zero and are only meaningful for Mamba/Jamba/Qwen3.5 hybrid architectures. RoPE section fields (`rope_sections`, `rope_attn_factor`, `rope_scaling_factor`, `rope_original_context`) are used only by the `qwen35` IMRoPE scheme."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Normalized model dimensions and routing metadata extracted from GGUF fields.\nSSM-specific fields (`ssm_d_*`, `ssm_n_group`, `full_attn_interval`) default to\nzero and are only meaningful for Mamba/Jamba/Qwen3.5 hybrid architectures.\nRoPE section fields (`rope_sections`, `rope_attn_factor`, `rope_scaling_factor`,\n`rope_original_context`) are used only by the `qwen35` IMRoPE scheme."
              },
              "members": []
            },
            {
              "name": "parseArchitecture",
              "qualified_name": "parseArchitecture",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseArchitecture(arch_str: []const u8) Architecture",
              "anchor": "parse-architecture",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/config/#parse-architecture",
              "source_path": "src/model/config.zig",
              "source_line": 68,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/config.zig#L68",
              "doc": {
                "summary": "Map a GGUF `general.architecture` string to an `Architecture` variant.",
                "description": [
                  "The mapping is many-to-one: architecturally equivalent families share a variant (e.g. `\"llama\"` → `.mistral`, `\"qwen3\"` → `.qwen2`), so callers must not assume the variant name matches the original GGUF string."
                ],
                "params": [
                  {
                    "name": "arch_str",
                    "description": "The raw architecture string from GGUF metadata, e.g. `\"qwen2\"`."
                  }
                ],
                "returns": "The matching `Architecture` variant, or `.unknown` if unrecognised.",
                "notes": [],
                "raw": "Map a GGUF `general.architecture` string to an `Architecture` variant.\nThe mapping is many-to-one: architecturally equivalent families share a variant\n(e.g. `\"llama\"` → `.mistral`, `\"qwen3\"` → `.qwen2`), so callers must not\nassume the variant name matches the original GGUF string."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "gguf",
          "title": "GGUF",
          "section": "Model Format & Loading",
          "summary": "Parse GGUF container files and expose the metadata needed by the loader.",
          "overview": [
            "The helpers in this module decode GGUF headers, metadata values, tensor offsets, and GGML quantization information without copying the whole file."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/",
          "source_path": "src/model/gguf.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L10",
          "counts": {
            "code_lines": 451,
            "exports": 10,
            "methods": 15,
            "symbols": 25
          },
          "symbols": [
            {
              "name": "GGUF_MAGIC",
              "qualified_name": "GGUF_MAGIC",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const GGUF_MAGIC: u32 = 0x46554747",
              "anchor": "gguf-magic",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguf-magic",
              "source_path": "src/model/gguf.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L10",
              "doc": {
                "summary": "Little-endian magic value expected at the start of every GGUF file.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Little-endian magic value expected at the start of every GGUF file."
              },
              "members": []
            },
            {
              "name": "GGUFVersion",
              "qualified_name": "GGUFVersion",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const GGUFVersion = enum(u32)",
              "anchor": "ggufversion",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#ggufversion",
              "source_path": "src/model/gguf.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L13",
              "doc": {
                "summary": "GGUF container versions recognized by the parser.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GGUF container versions recognized by the parser."
              },
              "members": []
            },
            {
              "name": "GGUFType",
              "qualified_name": "GGUFType",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const GGUFType = enum(u32)",
              "anchor": "gguftype",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguftype",
              "source_path": "src/model/gguf.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L20",
              "doc": {
                "summary": "Primitive metadata value tags defined by the GGUF format.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Primitive metadata value tags defined by the GGUF format."
              },
              "members": []
            },
            {
              "name": "GGMLType",
              "qualified_name": "GGMLType",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const GGMLType = enum(u32)",
              "anchor": "ggmltype",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#ggmltype",
              "source_path": "src/model/gguf.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L38",
              "doc": {
                "summary": "GGML tensor storage and quantization formats referenced by GGUF tensors.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GGML tensor storage and quantization formats referenced by GGUF tensors."
              },
              "members": [
                {
                  "name": "blockSize",
                  "qualified_name": "GGMLType.blockSize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn blockSize(self: GGMLType) u32",
                  "anchor": "ggmltype-block-size",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#ggmltype-block-size",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 75,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L75",
                  "doc": {
                    "summary": "Return the number of tensor elements encoded by one storage block.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "GGML tensor format to inspect."
                      }
                    ],
                    "returns": "The number of logical elements represented by one block of this format.",
                    "notes": [
                      "Quantized formats pack many elements into one block, while plain scalar types return `1`."
                    ],
                    "raw": "Return the number of tensor elements encoded by one storage block."
                  }
                },
                {
                  "name": "bytesPerBlock",
                  "qualified_name": "GGMLType.bytesPerBlock",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn bytesPerBlock(self: GGMLType) u32",
                  "anchor": "ggmltype-bytes-per-block",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#ggmltype-bytes-per-block",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 97,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L97",
                  "doc": {
                    "summary": "Return the serialized byte width of one storage block.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "GGML tensor format to inspect."
                      }
                    ],
                    "returns": "The number of on-disk bytes consumed by one block of this format.",
                    "notes": [
                      "Use this together with `blockSize()` to convert element counts into tensor byte ranges."
                    ],
                    "raw": "Return the serialized byte width of one storage block."
                  }
                }
              ]
            },
            {
              "name": "MetadataValue",
              "qualified_name": "MetadataValue",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const MetadataValue = union(enum)",
              "anchor": "metadata-value",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value",
              "source_path": "src/model/gguf.zig",
              "source_line": 126,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L126",
              "doc": {
                "summary": "Typed representation of a GGUF metadata value.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Typed representation of a GGUF metadata value."
              },
              "members": [
                {
                  "name": "asString",
                  "qualified_name": "MetadataValue.asString",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn asString(self: MetadataValue) ?[]const u8",
                  "anchor": "metadata-value-as-string",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value-as-string",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 143,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L143",
                  "doc": {
                    "summary": "Interpret the metadata value as a string slice when the stored type is `.string`.",
                    "description": [],
                    "params": [],
                    "returns": "The string contents, or `null` when the value is not a string.",
                    "notes": [],
                    "raw": "Interpret the metadata value as a string slice when the stored type is `.string`."
                  }
                },
                {
                  "name": "asU32",
                  "qualified_name": "MetadataValue.asU32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn asU32(self: MetadataValue) ?u32",
                  "anchor": "metadata-value-as-u32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value-as-u32",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 152,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L152",
                  "doc": {
                    "summary": "Interpret the metadata value as an unsigned 32-bit integer when it fits.",
                    "description": [],
                    "params": [],
                    "returns": "A normalized `u32` or `null` when the stored value cannot be represented as one.",
                    "notes": [],
                    "raw": "Interpret the metadata value as an unsigned 32-bit integer when it fits."
                  }
                },
                {
                  "name": "asU64",
                  "qualified_name": "MetadataValue.asU64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn asU64(self: MetadataValue) ?u64",
                  "anchor": "metadata-value-as-u64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value-as-u64",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 163,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L163",
                  "doc": {
                    "summary": "Interpret the metadata value as an unsigned 64-bit integer when it fits.",
                    "description": [],
                    "params": [],
                    "returns": "A normalized `u64` or `null` when the stored value cannot be represented as one.",
                    "notes": [],
                    "raw": "Interpret the metadata value as an unsigned 64-bit integer when it fits."
                  }
                },
                {
                  "name": "asF32",
                  "qualified_name": "MetadataValue.asF32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn asF32(self: MetadataValue) ?f32",
                  "anchor": "metadata-value-as-f32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value-as-f32",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 174,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L174",
                  "doc": {
                    "summary": "Interpret the metadata value as a 32-bit floating-point number when possible.",
                    "description": [],
                    "params": [],
                    "returns": "An `f32` value or `null` when the stored value is not a floating-point type.",
                    "notes": [],
                    "raw": "Interpret the metadata value as a 32-bit floating-point number when possible."
                  }
                },
                {
                  "name": "asBool",
                  "qualified_name": "MetadataValue.asBool",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn asBool(self: MetadataValue) ?bool",
                  "anchor": "metadata-value-as-bool",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#metadata-value-as-bool",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 184,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L184",
                  "doc": {
                    "summary": "Interpret the metadata value as a boolean when possible.",
                    "description": [],
                    "params": [],
                    "returns": "A normalized `bool` or `null` when the stored value is not boolean-like.",
                    "notes": [],
                    "raw": "Interpret the metadata value as a boolean when possible."
                  }
                }
              ]
            },
            {
              "name": "TensorInfo",
              "qualified_name": "TensorInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const TensorInfo = struct",
              "anchor": "tensor-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#tensor-info",
              "source_path": "src/model/gguf.zig",
              "source_line": 196,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L196",
              "doc": {
                "summary": "Tensor descriptor read from the GGUF header for a single named weight tensor.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tensor descriptor read from the GGUF header for a single named weight tensor."
              },
              "members": [
                {
                  "name": "numElements",
                  "qualified_name": "TensorInfo.numElements",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn numElements(self: *const TensorInfo) u64",
                  "anchor": "tensor-info-num-elements",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#tensor-info-num-elements",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 211,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L211",
                  "doc": {
                    "summary": "Multiply the active tensor dimensions to get the logical element count.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Tensor descriptor to inspect."
                      }
                    ],
                    "returns": "The total number of logical elements across the first `n_dims` entries in `dims`.",
                    "notes": [],
                    "raw": "Multiply the active tensor dimensions to get the logical element count."
                  }
                },
                {
                  "name": "sizeBytes",
                  "qualified_name": "TensorInfo.sizeBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sizeBytes(self: *const TensorInfo) u64",
                  "anchor": "tensor-info-size-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#tensor-info-size-bytes",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 223,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L223",
                  "doc": {
                    "summary": "Compute the serialized tensor byte size for the descriptor's GGML storage format.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Tensor descriptor to inspect."
                      }
                    ],
                    "returns": "The number of bytes occupied by the tensor payload, rounded up to whole quantization blocks.",
                    "notes": [
                      "Quantized tensors round element counts up to a full block before multiplying by bytes-per-block."
                    ],
                    "raw": "Compute the serialized tensor byte size for the descriptor's GGML storage format."
                  }
                }
              ]
            },
            {
              "name": "GGUFFile",
              "qualified_name": "GGUFFile",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GGUFFile = struct",
              "anchor": "gguffile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile",
              "source_path": "src/model/gguf.zig",
              "source_line": 234,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L234",
              "doc": {
                "summary": "Fully decoded GGUF file: header fields, key-value metadata, and tensor descriptor table.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fully decoded GGUF file: header fields, key-value metadata, and tensor descriptor table."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "GGUFFile.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *GGUFFile) void",
                  "anchor": "gguffile-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-deinit",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 250,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L250",
                  "doc": {
                    "summary": "Release metadata keys, metadata payloads, and tensor names owned by the parsed file.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release metadata keys, metadata payloads, and tensor names owned by the parsed file."
                  }
                },
                {
                  "name": "getString",
                  "qualified_name": "GGUFFile.getString",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn getString(self: *const GGUFFile, key: []const u8) ?[]const u8",
                  "anchor": "gguffile-get-string",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-get-string",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 271,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L271",
                  "doc": {
                    "summary": "Look up a metadata string value by key.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file."
                      },
                      {
                        "name": "key",
                        "description": "Metadata key to search for."
                      }
                    ],
                    "returns": "The stored string value when present and typed as `.string`.",
                    "notes": [],
                    "raw": "Look up a metadata string value by key."
                  }
                },
                {
                  "name": "getU32",
                  "qualified_name": "GGUFFile.getU32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn getU32(self: *const GGUFFile, key: []const u8) ?u32",
                  "anchor": "gguffile-get-u32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-get-u32",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 280,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L280",
                  "doc": {
                    "summary": "Look up a metadata value as `u32` when it can be normalized to that type.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file."
                      },
                      {
                        "name": "key",
                        "description": "Metadata key to search for."
                      }
                    ],
                    "returns": "The normalized integer value when present.",
                    "notes": [],
                    "raw": "Look up a metadata value as `u32` when it can be normalized to that type."
                  }
                },
                {
                  "name": "getF32",
                  "qualified_name": "GGUFFile.getF32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn getF32(self: *const GGUFFile, key: []const u8) ?f32",
                  "anchor": "gguffile-get-f32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-get-f32",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 289,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L289",
                  "doc": {
                    "summary": "Look up a metadata value as `f32` when it can be normalized to that type.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file."
                      },
                      {
                        "name": "key",
                        "description": "Metadata key to search for."
                      }
                    ],
                    "returns": "The normalized floating-point value when present.",
                    "notes": [],
                    "raw": "Look up a metadata value as `f32` when it can be normalized to that type."
                  }
                },
                {
                  "name": "getBool",
                  "qualified_name": "GGUFFile.getBool",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn getBool(self: *const GGUFFile, key: []const u8) ?bool",
                  "anchor": "gguffile-get-bool",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-get-bool",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 298,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L298",
                  "doc": {
                    "summary": "Look up a metadata value as `bool` when it can be normalized to that type.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file."
                      },
                      {
                        "name": "key",
                        "description": "Metadata key to search for."
                      }
                    ],
                    "returns": "The normalized boolean value when present.",
                    "notes": [],
                    "raw": "Look up a metadata value as `bool` when it can be normalized to that type."
                  }
                },
                {
                  "name": "findTensor",
                  "qualified_name": "GGUFFile.findTensor",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn findTensor(self: *const GGUFFile, name: []const u8) ?*const TensorInfo",
                  "anchor": "gguffile-find-tensor",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#gguffile-find-tensor",
                  "source_path": "src/model/gguf.zig",
                  "source_line": 307,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L307",
                  "doc": {
                    "summary": "Find a tensor descriptor by name.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Parsed GGUF file."
                      },
                      {
                        "name": "name",
                        "description": "Tensor name to look up."
                      }
                    ],
                    "returns": "A pointer to the tensor descriptor when the tensor exists.",
                    "notes": [],
                    "raw": "Find a tensor descriptor by name."
                  }
                }
              ]
            },
            {
              "name": "ParseOptions",
              "qualified_name": "ParseOptions",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ParseOptions = struct",
              "anchor": "parse-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#parse-options",
              "source_path": "src/model/gguf.zig",
              "source_line": 329,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L329",
              "doc": {
                "summary": "Optional flags that control GGUF parsing behavior.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Optional flags that control GGUF parsing behavior."
              },
              "members": []
            },
            {
              "name": "parse",
              "qualified_name": "parse",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parse(data: []const u8, allocator: std.mem.Allocator) !GGUFFile",
              "anchor": "parse",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#parse",
              "source_path": "src/model/gguf.zig",
              "source_line": 339,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L339",
              "doc": {
                "summary": "Parse a GGUF file from a byte slice.",
                "description": [],
                "params": [
                  {
                    "name": "data",
                    "description": "Raw GGUF bytes, typically from a memory-mapped file."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for metadata strings, arrays, and tensor descriptors."
                  }
                ],
                "returns": "A `GGUFFile` with all data heap-allocated; call `deinit` to free all owned memory.",
                "notes": [],
                "raw": "Parse a GGUF file from a byte slice."
              },
              "members": []
            },
            {
              "name": "parseWithOptions",
              "qualified_name": "parseWithOptions",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseWithOptions(data: []const u8, allocator: std.mem.Allocator, options: ParseOptions) !GGUFFile",
              "anchor": "parse-with-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gguf/#parse-with-options",
              "source_path": "src/model/gguf.zig",
              "source_line": 349,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/gguf.zig#L349",
              "doc": {
                "summary": "Parse a GGUF file from a byte slice with optional logging control.",
                "description": [],
                "params": [
                  {
                    "name": "data",
                    "description": "Raw GGUF bytes, typically from a memory-mapped file."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for metadata keys, string values, array payloads, and tensor name copies."
                  },
                  {
                    "name": "options",
                    "description": "Flags controlling parse-time side effects such as summary logging."
                  }
                ],
                "returns": "A `GGUFFile` whose string data is heap-allocated; call `deinit` to free all owned memory.",
                "notes": [
                  "Returns `error.InvalidMagic` when the four-byte magic is wrong, or `error.UnknownMetadataType` for unrecognized type tags."
                ],
                "raw": "Parse a GGUF file from a byte slice with optional logging control."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "loader-cuda",
          "title": "Loader Cuda",
          "section": "Model Format & Loading",
          "summary": "CUDA-specific model loading — mmap the GGUF, upload every tensor to the NVIDIA device, and expose them to the CUDA forward pass.",
          "overview": [
            "Unlike the Metal loader (Apple unified memory, zero-copy newBufferWithBytesNoCopy), CUDA device memory is NOT CPU-visible, so each tensor is copied host->device once at load time via `cuda_buffer.uploadMmap`. The file mapping is kept alive after upload because the embedding lookup (`dequantEmbeddingRow`) dequantizes a single `token_embd.weight` row on the CPU directly out of the mapping.",
            "GGUF parsing and config extraction are backend-agnostic; the config extractor below is copied verbatim from loader_metal.zig (pure metadata reads, no backend dependency). `dequantRow`/`getScaleMinK4` are copied from compute/forward_metal.zig to avoid importing the Metal forward pass (which would drag in Metal-only dependencies)."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/",
          "source_path": "src/model/loader_cuda.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L30",
          "counts": {
            "code_lines": 556,
            "exports": 4,
            "methods": 5,
            "symbols": 9
          },
          "symbols": [
            {
              "name": "LoadedTensor",
              "qualified_name": "LoadedTensor",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadedTensor = struct",
              "anchor": "loaded-tensor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#loaded-tensor",
              "source_path": "src/model/loader_cuda.zig",
              "source_line": 30,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L30",
              "doc": {
                "summary": "A GGUF tensor descriptor paired with the device buffer holding its weights.",
                "description": [
                  "`info` carries the on-disk shape/quant/offset metadata; `gpu_buffer` is the device-local copy uploaded at load time."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A GGUF tensor descriptor paired with the device buffer holding its weights.\n`info` carries the on-disk shape/quant/offset metadata; `gpu_buffer` is the\ndevice-local copy uploaded at load time."
              },
              "members": []
            },
            {
              "name": "Model",
              "qualified_name": "Model",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Model = struct",
              "anchor": "model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model",
              "source_path": "src/model/loader_cuda.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L38",
              "doc": {
                "summary": "Runtime model state: parsed config, the live CUDA context, every weight tensor resident on the GPU, and the still-mapped GGUF file (kept alive for CPU-side embedding dequantization).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime model state: parsed config, the live CUDA context, every weight\ntensor resident on the GPU, and the still-mapped GGUF file (kept alive for\nCPU-side embedding dequantization)."
              },
              "members": [
                {
                  "name": "load",
                  "qualified_name": "Model.load",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn load(allocator: std.mem.Allocator, ctx: ?*shim.CudaCtx, path: []const u8) !Model",
                  "anchor": "model-load",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model-load",
                  "source_path": "src/model/loader_cuda.zig",
                  "source_line": 64,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L64",
                  "doc": {
                    "summary": "Open + mmap the GGUF at `path`, parse it, extract the config, and upload every tensor to `ctx`.",
                    "description": [
                      "The mapping is retained for embedding lookups."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Owns the GGUF metadata, the tensor list, and the name map."
                      },
                      {
                        "name": "ctx",
                        "description": "Live CUDA context that will own every uploaded weight buffer."
                      },
                      {
                        "name": "path",
                        "description": "Filesystem path to the GGUF model."
                      }
                    ],
                    "returns": "A fully resident `Model`; call `deinit` to release device + host memory.",
                    "notes": [],
                    "raw": "Open + mmap the GGUF at `path`, parse it, extract the config, and upload\nevery tensor to `ctx`. The mapping is retained for embedding lookups."
                  }
                },
                {
                  "name": "get",
                  "qualified_name": "Model.get",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn get(self: *const Model, name: []const u8) ?*const LoadedTensor",
                  "anchor": "model-get",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model-get",
                  "source_path": "src/model/loader_cuda.zig",
                  "source_line": 144,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L144",
                  "doc": {
                    "summary": "Look up a tensor by its exact GGUF name (e.g.",
                    "description": [
                      "`\"blk.3.attn_q.weight\"`)."
                    ],
                    "params": [],
                    "returns": "A pointer to the loaded tensor, or null if absent.",
                    "notes": [],
                    "raw": "Look up a tensor by its exact GGUF name (e.g. `\"blk.3.attn_q.weight\"`)."
                  }
                },
                {
                  "name": "getLayer",
                  "qualified_name": "Model.getLayer",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn getLayer(self: *const Model, layer: u32, suffix: []const u8) ?*const LoadedTensor",
                  "anchor": "model-get-layer",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model-get-layer",
                  "source_path": "src/model/loader_cuda.zig",
                  "source_line": 152,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L152",
                  "doc": {
                    "summary": "Look up a per-layer tensor by formatting `\"blk.{layer}.{suffix}\"`.",
                    "description": [],
                    "params": [
                      {
                        "name": "layer",
                        "description": "Zero-based transformer block index."
                      },
                      {
                        "name": "suffix",
                        "description": "Tensor suffix within the block, e.g. `\"attn_q.weight\"`."
                      }
                    ],
                    "returns": "A pointer to the loaded tensor, or null if absent.",
                    "notes": [],
                    "raw": "Look up a per-layer tensor by formatting `\"blk.{layer}.{suffix}\"`."
                  }
                },
                {
                  "name": "dequantEmbeddingRow",
                  "qualified_name": "Model.dequantEmbeddingRow",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dequantEmbeddingRow(self: *const Model, token_id: u32, out: []f32) void",
                  "anchor": "model-dequant-embedding-row",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model-dequant-embedding-row",
                  "source_path": "src/model/loader_cuda.zig",
                  "source_line": 163,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L163",
                  "doc": {
                    "summary": "Dequantize one row of `token_embd.weight` to f32 on the CPU.",
                    "description": [
                      "Reads the raw tensor bytes directly out of the live mapping (no device round-trip). `token_id` is clamped to the last valid row."
                    ],
                    "params": [
                      {
                        "name": "token_id",
                        "description": "Token whose embedding row to fetch."
                      },
                      {
                        "name": "out",
                        "description": "Destination slice of at least `hidden_dim` f32 values; filled in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Dequantize one row of `token_embd.weight` to f32 on the CPU.\nReads the raw tensor bytes directly out of the live mapping (no device\nround-trip). `token_id` is clamped to the last valid row."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Model.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Model) void",
                  "anchor": "model-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#model-deinit",
                  "source_path": "src/model/loader_cuda.zig",
                  "source_line": 189,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L189",
                  "doc": {
                    "summary": "Release device buffers, the GGUF metadata, the name map, and the mapping.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release device buffers, the GGUF metadata, the name map, and the mapping."
                  }
                }
              ]
            },
            {
              "name": "inspectConfig",
              "qualified_name": "inspectConfig",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn inspectConfig(path: []const u8, allocator: std.mem.Allocator) !ModelConfig",
              "anchor": "inspect-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#inspect-config",
              "source_path": "src/model/loader_cuda.zig",
              "source_line": 217,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L217",
              "doc": {
                "summary": "Inspect a GGUF model's config without uploading any weights to the GPU.",
                "description": [
                  "mmaps the file, parses the header, extracts the `ModelConfig`, then unmaps — used by `zinc --check` to report architecture/dims on the CUDA backend."
                ],
                "params": [
                  {
                    "name": "path",
                    "description": "Filesystem path to the GGUF model."
                  },
                  {
                    "name": "allocator",
                    "description": "Owns the transient GGUF metadata (freed before returning)."
                  }
                ],
                "returns": "The parsed `ModelConfig`.",
                "notes": [],
                "raw": "Inspect a GGUF model's config without uploading any weights to the GPU.\nmmaps the file, parses the header, extracts the `ModelConfig`, then unmaps —\nused by `zinc --check` to report architecture/dims on the CUDA backend."
              },
              "members": []
            },
            {
              "name": "dequantRow",
              "qualified_name": "dequantRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dequantRow(raw_data: []const u8, row: u32, cols: u32, quant_type: GGMLType, output: []f32) void",
              "anchor": "dequant-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-cuda/#dequant-row",
              "source_path": "src/model/loader_cuda.zig",
              "source_line": 472,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_cuda.zig#L472",
              "doc": {
                "summary": "Dequantize one row of quantized weight data to f32 values.",
                "description": [
                  "Supports f32, f16, Q5_0, Q5_1, Q8_0, Q4_K, Q5_K, Q6_K, and MXFP4. Unsupported types log a warning and zero the output slice."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the full matrix."
                  },
                  {
                    "name": "row",
                    "description": "Zero-based row index to dequantize."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns (elements) per row."
                  },
                  {
                    "name": "quant_type",
                    "description": "GGML quantization type describing the on-disk layout."
                  },
                  {
                    "name": "output",
                    "description": "Caller-allocated slice of at least `cols` f32 values; filled in place."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Dequantize one row of quantized weight data to f32 values.\nSupports f32, f16, Q5_0, Q5_1, Q8_0, Q4_K, Q5_K, Q6_K, and MXFP4.\nUnsupported types log a warning and zero the output slice."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "loader-metal",
          "title": "Loader Metal",
          "section": "Model Format & Loading",
          "summary": "Metal-specific model loading — zero-copy via mmap + newBufferWithBytesNoCopy.",
          "overview": [
            "This replaces the Vulkan loader's staging-buffer DMA with direct mmap wrapping."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/",
          "source_path": "src/model/loader_metal.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L16",
          "counts": {
            "code_lines": 787,
            "exports": 7,
            "methods": 1,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "ModelInspection",
              "qualified_name": "ModelInspection",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelInspection = struct",
              "anchor": "model-inspection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#model-inspection",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L16",
              "doc": {
                "summary": "Summary returned by `inspectModel`: config plus file and tensor size statistics.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Summary returned by `inspectModel`: config plus file and tensor size statistics."
              },
              "members": []
            },
            {
              "name": "LoadedTensor",
              "qualified_name": "LoadedTensor",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadedTensor = struct",
              "anchor": "loaded-tensor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#loaded-tensor",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L29",
              "doc": {
                "summary": "A tensor descriptor paired with a Metal buffer holding its weight data (mmap-wrapped or copied).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A tensor descriptor paired with a Metal buffer holding its weight data (mmap-wrapped or copied)."
              },
              "members": []
            },
            {
              "name": "Model",
              "qualified_name": "Model",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Model = struct",
              "anchor": "model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#model",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L36",
              "doc": {
                "summary": "Runtime model state backed by a memory-mapped GGUF file and zero-copy Metal buffers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime model state backed by a memory-mapped GGUF file and zero-copy Metal buffers."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "Model.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Model) void",
                  "anchor": "model-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#model-deinit",
                  "source_path": "src/model/loader_metal.zig",
                  "source_line": 49,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L49",
                  "doc": {
                    "summary": "Release Metal buffers, GGUF metadata, and the backing file mapping.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release Metal buffers, GGUF metadata, and the backing file mapping."
                  }
                }
              ]
            },
            {
              "name": "residentWeightBytes",
              "qualified_name": "residentWeightBytes",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn residentWeightBytes(model: *const Model) u64",
              "anchor": "resident-weight-bytes",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#resident-weight-bytes",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 85,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L85",
              "doc": {
                "summary": "Returns the total byte count of model weights that are resident as Metal resources.",
                "description": [
                  "Copied tensor arenas replace their mmap-backed tensors in the GPU-visible working set, so arena bytes are counted once and aliased per-tensor handles are skipped to avoid double-counting."
                ],
                "params": [
                  {
                    "name": "model",
                    "description": "The loaded model whose resident weight size to measure."
                  }
                ],
                "returns": "Total bytes across all Metal-resident weight buffers (arenas + owned tensors).",
                "notes": [],
                "raw": "Returns the total byte count of model weights that are resident as Metal resources.\nCopied tensor arenas replace their mmap-backed tensors in the GPU-visible working\nset, so arena bytes are counted once and aliased per-tensor handles are skipped to\navoid double-counting."
              },
              "members": []
            },
            {
              "name": "inspectConfig",
              "qualified_name": "inspectConfig",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn inspectConfig(path: []const u8, allocator: std.mem.Allocator) !ModelConfig",
              "anchor": "inspect-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#inspect-config",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 440,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L440",
              "doc": {
                "summary": "Parse a GGUF file's metadata and return the derived `ModelConfig` without touching the GPU.",
                "description": [
                  "The file is memory-mapped and unmapped before returning; no Metal resources are created."
                ],
                "params": [
                  {
                    "name": "path",
                    "description": "Filesystem path to the `.gguf` model file."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for GGUF metadata parsing (freed before return)."
                  }
                ],
                "returns": "Parsed `ModelConfig` or an error if the file cannot be opened or parsed.",
                "notes": [],
                "raw": "Parse a GGUF file's metadata and return the derived `ModelConfig` without touching the GPU.\nThe file is memory-mapped and unmapped before returning; no Metal resources are created."
              },
              "members": []
            },
            {
              "name": "inspectModel",
              "qualified_name": "inspectModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn inspectModel(path: []const u8, allocator: std.mem.Allocator) !ModelInspection",
              "anchor": "inspect-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#inspect-model",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 470,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L470",
              "doc": {
                "summary": "Parse a GGUF file and return a `ModelInspection` with size statistics and the derived config.",
                "description": [
                  "Computes the total raw byte size of all tensor payloads stored in the file. No GPU resources are created; the file mapping is released before returning."
                ],
                "params": [
                  {
                    "name": "path",
                    "description": "Filesystem path to the `.gguf` model file."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for GGUF metadata parsing (freed before return)."
                  }
                ],
                "returns": "`ModelInspection` containing file size, tensor byte count, and `ModelConfig`.",
                "notes": [],
                "raw": "Parse a GGUF file and return a `ModelInspection` with size statistics and the derived config.\nComputes the total raw byte size of all tensor payloads stored in the file. No GPU\nresources are created; the file mapping is released before returning."
              },
              "members": []
            },
            {
              "name": "load",
              "qualified_name": "load",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn load( path: []const u8, metal_ctx: ?*shim.MetalCtx, allocator: std.mem.Allocator, ) !Model",
              "anchor": "load",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader-metal/#load",
              "source_path": "src/model/loader_metal.zig",
              "source_line": 518,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader_metal.zig#L518",
              "doc": {
                "summary": "Load a GGUF model file and return a `Model` backed by zero-copy Metal buffers.",
                "description": [
                  "Each tensor's data is wrapped in a `newBufferWithBytesNoCopy` Metal buffer over the mmap'd file region. For model architectures that benefit from it (e.g. dense Gemma layers), select tensors are copied into pre-allocated Metal arenas to avoid UMA pressure from mixed mmap/Metal page-fault patterns. All weight buffers are registered with an `MTLResidencySet` on macOS 15+ to prevent paging between layers. supported architecture (qwen2, qwen2_moe, qwen35, mistral, mamba, jamba, gemma)."
                ],
                "params": [
                  {
                    "name": "path",
                    "description": "Filesystem path to the `.gguf` model file."
                  },
                  {
                    "name": "metal_ctx",
                    "description": "Active Metal context used to create and wrap GPU buffers; must be non-null."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator for tensor and arena bookkeeping (retained in the returned `Model`)."
                  }
                ],
                "returns": "Initialized `Model` or an error if the file cannot be mapped, parsed, or lacks a",
                "notes": [],
                "raw": "Load a GGUF model file and return a `Model` backed by zero-copy Metal buffers.\nEach tensor's data is wrapped in a `newBufferWithBytesNoCopy` Metal buffer over\nthe mmap'd file region. For model architectures that benefit from it (e.g. dense\nGemma layers), select tensors are copied into pre-allocated Metal arenas to avoid\nUMA pressure from mixed mmap/Metal page-fault patterns. All weight buffers are\nregistered with an `MTLResidencySet` on macOS 15+ to prevent paging between layers.\nsupported architecture (qwen2, qwen2_moe, qwen35, mistral, mamba, jamba, gemma)."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "loader",
          "title": "Loader",
          "section": "Model Format & Loading",
          "summary": "Build runtime model state from GGUF metadata and GPU-resident tensor buffers.",
          "overview": [
            "This module translates an on-disk GGUF file into the normalized model configuration and uploaded tensors consumed by the inference runtime."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/",
          "source_path": "src/model/loader.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L17",
          "counts": {
            "code_lines": 647,
            "exports": 13,
            "methods": 1,
            "symbols": 14
          },
          "symbols": [
            {
              "name": "Architecture",
              "qualified_name": "Architecture",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Architecture = config_mod.Architecture",
              "anchor": "architecture",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#architecture",
              "source_path": "src/model/loader.zig",
              "source_line": 17,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L17",
              "doc": {
                "summary": "Supported model architectures (re-exported from config.zig).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Supported model architectures (re-exported from config.zig)."
              },
              "members": []
            },
            {
              "name": "ModelConfig",
              "qualified_name": "ModelConfig",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ModelConfig = config_mod.ModelConfig",
              "anchor": "model-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#model-config",
              "source_path": "src/model/loader.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L20",
              "doc": {
                "summary": "Normalized model dimensions and hyperparameters (re-exported from config.zig).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Normalized model dimensions and hyperparameters (re-exported from config.zig)."
              },
              "members": []
            },
            {
              "name": "ModelInspection",
              "qualified_name": "ModelInspection",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelInspection = struct",
              "anchor": "model-inspection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#model-inspection",
              "source_path": "src/model/loader.zig",
              "source_line": 23,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L23",
              "doc": {
                "summary": "Summary returned by `inspectModel`: config plus file and tensor size statistics.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Summary returned by `inspectModel`: config plus file and tensor size statistics."
              },
              "members": []
            },
            {
              "name": "LoadedTensor",
              "qualified_name": "LoadedTensor",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadedTensor = struct",
              "anchor": "loaded-tensor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#loaded-tensor",
              "source_path": "src/model/loader.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L36",
              "doc": {
                "summary": "A tensor descriptor paired with the GPU buffer that stores its contents.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A tensor descriptor paired with the GPU buffer that stores its contents."
              },
              "members": []
            },
            {
              "name": "isMoEExpertTensor",
              "qualified_name": "isMoEExpertTensor",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn isMoEExpertTensor(name: []const u8) bool",
              "anchor": "is-mo-eexpert-tensor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#is-mo-eexpert-tensor",
              "source_path": "src/model/loader.zig",
              "source_line": 49,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L49",
              "doc": {
                "summary": "Return true if this GGUF tensor name designates a fused MoE expert weight tensor.",
                "description": [
                  "Matches the four suffixes emitted by GGUF for sparse-MoE architectures: `ffn_gate_exps.weight`, `ffn_up_exps.weight`, `ffn_down_exps.weight`, and `ffn_down_exps_scale.weight` (Q4_K_M variants only). Dense tensors and non-expert MoE tensors (router gate, attention, embeddings, etc.) are not matched."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return true if this GGUF tensor name designates a fused MoE expert weight tensor.\nMatches the four suffixes emitted by GGUF for sparse-MoE architectures:\n`ffn_gate_exps.weight`, `ffn_up_exps.weight`, `ffn_down_exps.weight`, and\n`ffn_down_exps_scale.weight` (Q4_K_M variants only).\nDense tensors and non-expert MoE tensors (router gate, attention, embeddings, etc.)\nare not matched."
              },
              "members": []
            },
            {
              "name": "computeOffloadDecision",
              "qualified_name": "computeOffloadDecision",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn computeOffloadDecision( override: OffloadOverride, total_tensor_bytes: u64, offloadable_tensor_bytes: u64, vram_budget_bytes: u64, ) bool",
              "anchor": "compute-offload-decision",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#compute-offload-decision",
              "source_path": "src/model/loader.zig",
              "source_line": 87,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L87",
              "doc": {
                "summary": "Compute whether MoE expert tensors should be offloaded to host RAM, without mutating any global state.",
                "description": [
                  "Suitable for unit tests and for use by the side-effecting `decideOffloadForLoad` wrapper."
                ],
                "params": [
                  {
                    "name": "override",
                    "description": "Explicit env-var override (.force_on/.force_off) or .auto."
                  },
                  {
                    "name": "total_tensor_bytes",
                    "description": "Total size of all model tensors in bytes."
                  },
                  {
                    "name": "offloadable_tensor_bytes",
                    "description": "Bytes belonging to MoE expert tensors only."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Reported VRAM capacity in bytes (from Vulkan device)."
                  }
                ],
                "returns": "true if expert tensors should be placed in host-visible memory.",
                "notes": [],
                "raw": "Compute whether MoE expert tensors should be offloaded to host RAM, without\nmutating any global state. Suitable for unit tests and for use by the\nside-effecting `decideOffloadForLoad` wrapper."
              },
              "members": []
            },
            {
              "name": "decideOffloadForLoad",
              "qualified_name": "decideOffloadForLoad",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn decideOffloadForLoad(total_tensor_bytes: u64, offloadable_tensor_bytes: u64, vram_budget_bytes: u64) bool",
              "anchor": "decide-offload-for-load",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#decide-offload-for-load",
              "source_path": "src/model/loader.zig",
              "source_line": 119,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L119",
              "doc": {
                "summary": "Decide whether to offload MoE expert tensors for the next model load and cache the decision in `offload_state`.",
                "description": [
                  "Honors `ZINC_OFFLOAD_MOE_EXPERTS` if set, otherwise auto-decides: - If the full model fits in VRAM (with headroom for KV/runtime): no offload. - If the model only fits with MoE experts in host RAM: enable offload. - If neither fits: don't enable (let allocation fail with a clear OOM instead of pretending to fit)."
                ],
                "params": [
                  {
                    "name": "total_tensor_bytes",
                    "description": "Total size of all model tensors in bytes."
                  },
                  {
                    "name": "offloadable_tensor_bytes",
                    "description": "Bytes belonging to MoE expert tensors only."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Reported VRAM capacity in bytes (from Vulkan device)."
                  }
                ],
                "returns": "true if expert tensors will be placed in host-visible memory.",
                "notes": [],
                "raw": "Decide whether to offload MoE expert tensors for the next model load and\ncache the decision in `offload_state`. Honors `ZINC_OFFLOAD_MOE_EXPERTS` if\nset, otherwise auto-decides:\n- If the full model fits in VRAM (with headroom for KV/runtime): no offload.\n- If the model only fits with MoE experts in host RAM: enable offload.\n- If neither fits: don't enable (let allocation fail with a clear OOM\ninstead of pretending to fit)."
              },
              "members": []
            },
            {
              "name": "offloadEnabled",
              "qualified_name": "offloadEnabled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn offloadEnabled() bool",
              "anchor": "offload-enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#offload-enabled",
              "source_path": "src/model/loader.zig",
              "source_line": 138,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L138",
              "doc": {
                "summary": "Return whether MoE expert tensors should be in host-visible memory for the currently-loaded model.",
                "description": [
                  "Reads the cached decision from `decideOffloadForLoad`. Returns false until a load has happened."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return whether MoE expert tensors should be in host-visible memory for the\ncurrently-loaded model. Reads the cached decision from `decideOffloadForLoad`.\nReturns false until a load has happened."
              },
              "members": []
            },
            {
              "name": "shouldOffloadToHost",
              "qualified_name": "shouldOffloadToHost",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn shouldOffloadToHost(name: []const u8) bool",
              "anchor": "should-offload-to-host",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#should-offload-to-host",
              "source_path": "src/model/loader.zig",
              "source_line": 147,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L147",
              "doc": {
                "summary": "Return true if this tensor should be allocated in host-visible memory rather than device-local VRAM.",
                "description": [
                  "Returns true only when MoE expert offload is enabled (see `offloadEnabled`) and the tensor name matches an expert weight suffix."
                ],
                "params": [
                  {
                    "name": "name",
                    "description": "GGUF tensor name to classify."
                  }
                ],
                "returns": "true if the tensor belongs to a MoE expert and offload is active.",
                "notes": [],
                "raw": "Return true if this tensor should be allocated in host-visible memory rather\nthan device-local VRAM. Returns true only when MoE expert offload is enabled\n(see `offloadEnabled`) and the tensor name matches an expert weight suffix."
              },
              "members": []
            },
            {
              "name": "Model",
              "qualified_name": "Model",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Model = struct",
              "anchor": "model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#model",
              "source_path": "src/model/loader.zig",
              "source_line": 152,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L152",
              "doc": {
                "summary": "Runtime model state backed by a memory-mapped GGUF file and uploaded tensor buffers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime model state backed by a memory-mapped GGUF file and uploaded tensor buffers."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "Model.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Model, instance: *const Instance) void",
                  "anchor": "model-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#model-deinit",
                  "source_path": "src/model/loader.zig",
                  "source_line": 169,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L169",
                  "doc": {
                    "summary": "Release tensor buffers, GGUF metadata, and the backing file mapping owned by the model.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Model instance to tear down in place."
                      },
                      {
                        "name": "instance",
                        "description": "Unused; accepted for call-site symmetry with other deinit patterns."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release tensor buffers, GGUF metadata, and the backing file mapping owned by the model."
                  }
                }
              ]
            },
            {
              "name": "inspectConfig",
              "qualified_name": "inspectConfig",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn inspectConfig(path: []const u8, allocator: std.mem.Allocator) !ModelConfig",
              "anchor": "inspect-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#inspect-config",
              "source_path": "src/model/loader.zig",
              "source_line": 460,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L460",
              "doc": {
                "summary": "Inspect a GGUF file and extract only the normalized model configuration.",
                "description": [],
                "params": [
                  {
                    "name": "path",
                    "description": "Path to the GGUF file on disk."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for the parsed metadata structures."
                  }
                ],
                "returns": "A ModelConfig derived from GGUF metadata without uploading tensors to the GPU.",
                "notes": [],
                "raw": "Inspect a GGUF file and extract only the normalized model configuration."
              },
              "members": []
            },
            {
              "name": "inspectModel",
              "qualified_name": "inspectModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn inspectModel(path: []const u8, allocator: std.mem.Allocator) !ModelInspection",
              "anchor": "inspect-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#inspect-model",
              "source_path": "src/model/loader.zig",
              "source_line": 491,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L491",
              "doc": {
                "summary": "Inspect a GGUF file and return a `ModelInspection` containing the normalized model config, the on-disk file size, total tensor byte count, offloadable (MoE expert) tensor byte count, tensor count, and metadata key count.",
                "description": [
                  "Does not allocate GPU resources or upload tensors."
                ],
                "params": [
                  {
                    "name": "path",
                    "description": "Path to the GGUF file on disk."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for the parsed GGUF metadata structures."
                  }
                ],
                "returns": "A `ModelInspection` with config and tensor/file size statistics.",
                "notes": [],
                "raw": "Inspect a GGUF file and return a `ModelInspection` containing the normalized\nmodel config, the on-disk file size, total tensor byte count, offloadable\n(MoE expert) tensor byte count, tensor count, and metadata key count.\nDoes not allocate GPU resources or upload tensors."
              },
              "members": []
            },
            {
              "name": "load",
              "qualified_name": "load",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn load( path: []const u8, instance: *const Instance, cmd_pool: *const CommandPool, allocator: std.mem.Allocator, ) !Model",
              "anchor": "load",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loader/#load",
              "source_path": "src/model/loader.zig",
              "source_line": 536,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/loader.zig#L536",
              "doc": {
                "summary": "Load a GGUF model: memory-map the file, parse headers, and DMA tensors to GPU VRAM.",
                "description": [],
                "params": [
                  {
                    "name": "path",
                    "description": "Path to the GGUF file on disk."
                  },
                  {
                    "name": "instance",
                    "description": "Active Vulkan instance used for buffer allocation."
                  },
                  {
                    "name": "cmd_pool",
                    "description": "Command pool used for staging copy operations."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for metadata, tensor lists, and temporary state."
                  }
                ],
                "returns": "A fully populated Model with parsed metadata and uploaded tensors.",
                "notes": [],
                "raw": "Load a GGUF model: memory-map the file, parse headers, and DMA tensors to GPU VRAM."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "tokenization",
      "title": "Tokenization",
      "description": "Prompt and output text conversion between UTF-8 strings and token IDs used by the decode loop.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#tokenization",
      "module_count": 1,
      "symbol_count": 15,
      "modules": [
        {
          "slug": "tokenizer",
          "title": "Tokenizer",
          "section": "Tokenization",
          "summary": "Native BPE tokenizer that reads vocabulary and merge rules from GGUF metadata.",
          "overview": [
            "Implements byte-pair encoding directly in Zig using the tokenizer tables embedded in GGUF model files, eliminating external tokenizer dependencies."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/",
          "source_path": "src/model/tokenizer.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L21",
          "counts": {
            "code_lines": 1796,
            "exports": 15,
            "methods": 0,
            "symbols": 15
          },
          "symbols": [
            {
              "name": "Tokenizer",
              "qualified_name": "Tokenizer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Tokenizer = struct",
              "anchor": "tokenizer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#tokenizer",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L21",
              "doc": {
                "summary": "A native BPE tokenizer backed by vocabulary and merge tables from GGUF metadata.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A native BPE tokenizer backed by vocabulary and merge tables from GGUF metadata."
              },
              "members": []
            },
            {
              "name": "initFromGGUF",
              "qualified_name": "initFromGGUF",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn initFromGGUF(gf: *const gguf.GGUFFile, allocator: std.mem.Allocator) !Tokenizer",
              "anchor": "init-from-gguf",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#init-from-gguf",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 72,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L72",
              "doc": {
                "summary": "Initialize a Tokenizer from an open GGUF file.",
                "description": [
                  "Reads `tokenizer.ggml.tokens`, `tokenizer.ggml.merges`, token scores, and special token IDs (BOS, EOS, add-BOS flag) from GGUF metadata. Also builds the `merge_ranks` lookup table so that subsequent `encode` calls are fast."
                ],
                "params": [
                  {
                    "name": "gf",
                    "description": "Parsed GGUF file whose metadata contains the tokenizer tables."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for all owned heap allocations; pass to `deinit` to free."
                  }
                ],
                "returns": "An initialized Tokenizer, or an error if required metadata is absent.",
                "notes": [],
                "raw": "Initialize a Tokenizer from an open GGUF file.\nReads `tokenizer.ggml.tokens`, `tokenizer.ggml.merges`, token scores, and\nspecial token IDs (BOS, EOS, add-BOS flag) from GGUF metadata.  Also builds\nthe `merge_ranks` lookup table so that subsequent `encode` calls are fast."
              },
              "members": []
            },
            {
              "name": "encode",
              "qualified_name": "encode",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn encode(self: *const Tokenizer, text: []const u8) ![]u32",
              "anchor": "encode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#encode",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 464,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L464",
              "doc": {
                "summary": "Encode UTF-8 text into a sequence of token IDs.",
                "description": [
                  "Applies the appropriate pretokenizer (Gemma-4 chunk splitter, GPT-2 word splitter, or legacy no-split) and then BPE or SentencePiece merges. The returned slice is owned by the caller; free it with `freeEncoded`."
                ],
                "params": [
                  {
                    "name": "text",
                    "description": "UTF-8 input to tokenize; an empty string returns an empty slice."
                  }
                ],
                "returns": "Heap-allocated token ID sequence, or an error on allocation failure.",
                "notes": [],
                "raw": "Encode UTF-8 text into a sequence of token IDs.\nApplies the appropriate pretokenizer (Gemma-4 chunk splitter, GPT-2 word\nsplitter, or legacy no-split) and then BPE or SentencePiece merges.\nThe returned slice is owned by the caller; free it with `freeEncoded`."
              },
              "members": []
            },
            {
              "name": "freeEncoded",
              "qualified_name": "freeEncoded",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freeEncoded(self: *const Tokenizer, tokens: []u32) void",
              "anchor": "free-encoded",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#free-encoded",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 507,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L507",
              "doc": {
                "summary": "Release a token slice returned by `encode`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Release a token slice returned by `encode`."
              },
              "members": []
            },
            {
              "name": "encodePrompt",
              "qualified_name": "encodePrompt",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn encodePrompt(self: *const Tokenizer, text: []const u8, allocator: std.mem.Allocator) ![]u32",
              "anchor": "encode-prompt",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#encode-prompt",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 516,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L516",
              "doc": {
                "summary": "Encode a prompt and prepend BOS when the model expects it.",
                "description": [
                  "The returned slice is allocated with `allocator`, so server routes can use a per-request allocator while the tokenizer keeps owning its internal scratch buffers. Special tokens (e.g. `<|start_header_id|>`) are resolved via `token_to_id` rather than being BPE-encoded character by character."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Encode a prompt and prepend BOS when the model expects it.\nThe returned slice is allocated with `allocator`, so server routes can use a\nper-request allocator while the tokenizer keeps owning its internal scratch buffers.\nSpecial tokens (e.g. `<|start_header_id|>`) are resolved via `token_to_id` rather\nthan being BPE-encoded character by character."
              },
              "members": []
            },
            {
              "name": "eosId",
              "qualified_name": "eosId",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn eosId(self: *const Tokenizer) u32",
              "anchor": "eos-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#eos-id",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 752,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L752",
              "doc": {
                "summary": "Return the model's end-of-sequence token ID as loaded from GGUF metadata.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return the model's end-of-sequence token ID as loaded from GGUF metadata."
              },
              "members": []
            },
            {
              "name": "isEndOfGeneration",
              "qualified_name": "isEndOfGeneration",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn isEndOfGeneration(self: *const Tokenizer, token: u32) bool",
              "anchor": "is-end-of-generation",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#is-end-of-generation",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 762,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L762",
              "doc": {
                "summary": "Whether a sampled token ends the current generation turn.",
                "description": [
                  "Always terminates on the configured EOS. Gemma 4 additionally uses `<eos>=1` and `</s>=212` alongside the primary `<turn|>=106` EOS — we treat those as EOG too when the chat template is Gemma, but not for other tokenizers (Qwen token 1 is a plain `\"` character)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether a sampled token ends the current generation turn.\n\nAlways terminates on the configured EOS. Gemma 4 additionally uses\n`<eos>=1` and `</s>=212` alongside the primary `<turn|>=106` EOS — we\ntreat those as EOG too when the chat template is Gemma, but not for\nother tokenizers (Qwen token 1 is a plain `\"` character)."
              },
              "members": []
            },
            {
              "name": "bosId",
              "qualified_name": "bosId",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn bosId(self: *const Tokenizer) u32",
              "anchor": "bos-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#bos-id",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 772,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L772",
              "doc": {
                "summary": "Return the model's beginning-of-sequence token ID.",
                "description": [
                  "Falls back to `eos_id` when no BOS token was found in GGUF metadata."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return the model's beginning-of-sequence token ID.\nFalls back to `eos_id` when no BOS token was found in GGUF metadata."
              },
              "members": []
            },
            {
              "name": "shouldPrependBos",
              "qualified_name": "shouldPrependBos",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn shouldPrependBos(self: *const Tokenizer) bool",
              "anchor": "should-prepend-bos",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#should-prepend-bos",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 779,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L779",
              "doc": {
                "summary": "Return true when prompt construction should prepend a BOS token.",
                "description": [
                  "Requires both `prepend_bos` (from GGUF metadata) to be set and a valid `bos_id` to exist; returns false if either condition is absent."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return true when prompt construction should prepend a BOS token.\nRequires both `prepend_bos` (from GGUF metadata) to be set and a valid\n`bos_id` to exist; returns false if either condition is absent."
              },
              "members": []
            },
            {
              "name": "preparePromptTokens",
              "qualified_name": "preparePromptTokens",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn preparePromptTokens(self: *const Tokenizer, raw_tokens: []const u32) ![]u32",
              "anchor": "prepare-prompt-tokens",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#prepare-prompt-tokens",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 789,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L789",
              "doc": {
                "summary": "Wrap a raw token sequence with BOS/EOS according to the GGUF metadata flags.",
                "description": [
                  "Prepends BOS when `shouldPrependBos()` is true and appends EOS when `add_eos_token` is set. Allocates the result with the tokenizer's own allocator; caller is responsible for freeing the returned slice."
                ],
                "params": [
                  {
                    "name": "raw_tokens",
                    "description": "The BPE-encoded token IDs to wrap."
                  }
                ],
                "returns": "A newly allocated slice with optional BOS prefix and EOS suffix.",
                "notes": [],
                "raw": "Wrap a raw token sequence with BOS/EOS according to the GGUF metadata flags.\nPrepends BOS when `shouldPrependBos()` is true and appends EOS when\n`add_eos_token` is set.  Allocates the result with the tokenizer's own\nallocator; caller is responsible for freeing the returned slice."
              },
              "members": []
            },
            {
              "name": "decodeToken",
              "qualified_name": "decodeToken",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn decodeToken(self: *const Tokenizer, token_id: u32, buf: []u8) []const u8",
              "anchor": "decode-token",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#decode-token",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 815,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L815",
              "doc": {
                "summary": "Decode a single token ID to UTF-8 text, reversing the GPT-2 byte-to-unicode mapping.",
                "description": [
                  "Handles SentencePiece word-boundary markers (▁ → space) and passes through non-ASCII codepoints (CJK, emoji) verbatim. Returns an empty string for out-of-range token IDs."
                ],
                "params": [
                  {
                    "name": "token_id",
                    "description": "Vocabulary index to decode."
                  },
                  {
                    "name": "buf",
                    "description": "Caller-supplied output buffer; result is a slice into this buffer."
                  }
                ],
                "returns": "UTF-8 bytes for the token, or an empty slice if the ID is out of range.",
                "notes": [],
                "raw": "Decode a single token ID to UTF-8 text, reversing the GPT-2 byte-to-unicode mapping.\nHandles SentencePiece word-boundary markers (▁ → space) and passes through\nnon-ASCII codepoints (CJK, emoji) verbatim.  Returns an empty string for\nout-of-range token IDs."
              },
              "members": []
            },
            {
              "name": "ChatTemplateOptions",
              "qualified_name": "ChatTemplateOptions",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ChatTemplateOptions = struct",
              "anchor": "chat-template-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#chat-template-options",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 871,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L871",
              "doc": {
                "summary": "Options controlling chat template rendering behavior.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Options controlling chat template rendering behavior."
              },
              "members": []
            },
            {
              "name": "supportsThinkingToggle",
              "qualified_name": "supportsThinkingToggle",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn supportsThinkingToggle(self: *const Tokenizer) bool",
              "anchor": "supports-thinking-toggle",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#supports-thinking-toggle",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 929,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L929",
              "doc": {
                "summary": "Return whether the model's chat template supports an explicit thinking toggle.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return whether the model's chat template supports an explicit thinking toggle."
              },
              "members": []
            },
            {
              "name": "applyChatTemplate",
              "qualified_name": "applyChatTemplate",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn applyChatTemplate(self: *const Tokenizer, roles: []const []const u8, contents: []const []const u8, buf: []u8) ![]const u8",
              "anchor": "apply-chat-template",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#apply-chat-template",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 944,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L944",
              "doc": {
                "summary": "Format a conversation into a model prompt using the embedded chat template.",
                "description": [
                  "Convenience wrapper around `applyChatTemplateWithOptions` with default options."
                ],
                "params": [
                  {
                    "name": "roles",
                    "description": "Parallel slice of role strings (e.g. \"user\", \"assistant\", \"system\")."
                  },
                  {
                    "name": "contents",
                    "description": "Parallel slice of message body strings."
                  },
                  {
                    "name": "buf",
                    "description": "Caller-supplied output buffer that receives the formatted prompt."
                  }
                ],
                "returns": "A slice of `buf` containing the rendered prompt.",
                "notes": [],
                "raw": "Format a conversation into a model prompt using the embedded chat template.\nConvenience wrapper around `applyChatTemplateWithOptions` with default options."
              },
              "members": []
            },
            {
              "name": "applyChatTemplateWithOptions",
              "qualified_name": "applyChatTemplateWithOptions",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn applyChatTemplateWithOptions(self: *const Tokenizer, roles: []const []const u8, contents: []const []const u8, options: ChatTemplateOptions, buf: []u8) ![]const u8",
              "anchor": "apply-chat-template-with-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tokenizer/#apply-chat-template-with-options",
              "source_path": "src/model/tokenizer.zig",
              "source_line": 957,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/tokenizer.zig#L957",
              "doc": {
                "summary": "Format a conversation into a model prompt with fine-grained rendering control.",
                "description": [
                  "Dispatches to the appropriate template renderer (ChatML, Llama-3, Gemma, OpenAI-MoE, or generic) based on `detectTemplateKind()`. Supports optional thinking tags, tool definitions, forced tool-call prefills, and generation-prompt suffixes."
                ],
                "params": [
                  {
                    "name": "roles",
                    "description": "Parallel slice of role strings (e.g. \"user\", \"assistant\", \"system\")."
                  },
                  {
                    "name": "contents",
                    "description": "Parallel slice of message body strings."
                  },
                  {
                    "name": "options",
                    "description": "Rendering options; see `ChatTemplateOptions` for details."
                  },
                  {
                    "name": "buf",
                    "description": "Caller-supplied output buffer that receives the formatted prompt."
                  }
                ],
                "returns": "A slice of `buf` containing the rendered prompt.",
                "notes": [],
                "raw": "Format a conversation into a model prompt with fine-grained rendering control.\nDispatches to the appropriate template renderer (ChatML, Llama-3, Gemma, OpenAI-MoE,\nor generic) based on `detectTemplateKind()`.  Supports optional thinking tags,\ntool definitions, forced tool-call prefills, and generation-prompt suffixes."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "decode-planning",
      "title": "Decode Planning",
      "description": "Static graph construction and dependency ordering for the per-token compute work that the runtime records and submits.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#decode-planning",
      "module_count": 5,
      "symbol_count": 57,
      "modules": [
        {
          "slug": "graph",
          "title": "Graph",
          "section": "Decode Planning",
          "summary": "Represent decode work as a dependency graph that can be topologically ordered.",
          "overview": [
            "Graph builders use this module to describe fused operations, dependencies, and dispatch metadata before any Vulkan command recording happens."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/",
          "source_path": "src/compute/graph.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L10",
          "counts": {
            "code_lines": 1191,
            "exports": 12,
            "methods": 21,
            "symbols": 33
          },
          "symbols": [
            {
              "name": "ExecDomain",
              "qualified_name": "ExecDomain",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const ExecDomain = enum",
              "anchor": "exec-domain",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#exec-domain",
              "source_path": "src/compute/graph.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L10",
              "doc": {
                "summary": "Where a graph node executes: GPU compute, GPU transfer, or CPU host.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Where a graph node executes: GPU compute, GPU transfer, or CPU host."
              },
              "members": []
            },
            {
              "name": "BottleneckKind",
              "qualified_name": "BottleneckKind",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const BottleneckKind = enum",
              "anchor": "bottleneck-kind",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#bottleneck-kind",
              "source_path": "src/compute/graph.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L20",
              "doc": {
                "summary": "Classification of the dominant performance bottleneck for a graph node.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Classification of the dominant performance bottleneck for a graph node."
              },
              "members": []
            },
            {
              "name": "HardwareInfo",
              "qualified_name": "HardwareInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const HardwareInfo = struct",
              "anchor": "hardware-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#hardware-info",
              "source_path": "src/compute/graph.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L38",
              "doc": {
                "summary": "Hardware parameters used by bottleneck and utilization heuristics.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Hardware parameters used by bottleneck and utilization heuristics."
              },
              "members": []
            },
            {
              "name": "OpType",
              "qualified_name": "OpType",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const OpType = enum",
              "anchor": "op-type",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#op-type",
              "source_path": "src/compute/graph.zig",
              "source_line": 53,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L53",
              "doc": {
                "summary": "Operation types that a compute graph node can represent.",
                "description": [
                  "Each variant maps to one GPU shader dispatch or fused kernel invocation during decode-time execution."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Operation types that a compute graph node can represent.\n\nEach variant maps to one GPU shader dispatch or fused kernel invocation\nduring decode-time execution."
              },
              "members": []
            },
            {
              "name": "Node",
              "qualified_name": "Node",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Node = struct",
              "anchor": "node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#node",
              "source_path": "src/compute/graph.zig",
              "source_line": 108,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L108",
              "doc": {
                "summary": "A single operation node in the compute dependency graph.",
                "description": [
                  "Each node carries dispatch metadata (workgroups, push constants) and dependency edges so the graph can be topologically sorted before recording."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A single operation node in the compute dependency graph.\n\nEach node carries dispatch metadata (workgroups, push constants) and\ndependency edges so the graph can be topologically sorted before recording."
              },
              "members": []
            },
            {
              "name": "Edge",
              "qualified_name": "Edge",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Edge = struct",
              "anchor": "edge",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#edge",
              "source_path": "src/compute/graph.zig",
              "source_line": 157,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L157",
              "doc": {
                "summary": "Directed dependency edge between two graph nodes.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Directed dependency edge between two graph nodes."
              },
              "members": []
            },
            {
              "name": "OpCount",
              "qualified_name": "OpCount",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const OpCount = struct",
              "anchor": "op-count",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#op-count",
              "source_path": "src/compute/graph.zig",
              "source_line": 165,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L165",
              "doc": {
                "summary": "Count of nodes that share the same operation type.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Count of nodes that share the same operation type."
              },
              "members": []
            },
            {
              "name": "CriticalPathNode",
              "qualified_name": "CriticalPathNode",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CriticalPathNode = struct",
              "anchor": "critical-path-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#critical-path-node",
              "source_path": "src/compute/graph.zig",
              "source_line": 173,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L173",
              "doc": {
                "summary": "Critical-path node annotated with its dependency depth.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Critical-path node annotated with its dependency depth."
              },
              "members": []
            },
            {
              "name": "NodeAnalysis",
              "qualified_name": "NodeAnalysis",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const NodeAnalysis = struct",
              "anchor": "node-analysis",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#node-analysis",
              "source_path": "src/compute/graph.zig",
              "source_line": 185,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L185",
              "doc": {
                "summary": "Per-node structural metrics derived from the dependency graph.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-node structural metrics derived from the dependency graph."
              },
              "members": []
            },
            {
              "name": "Hotspot",
              "qualified_name": "Hotspot",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Hotspot = struct",
              "anchor": "hotspot",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#hotspot",
              "source_path": "src/compute/graph.zig",
              "source_line": 241,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L241",
              "doc": {
                "summary": "A node ranked among the top contributors to estimated decode time.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A node ranked among the top contributors to estimated decode time."
              },
              "members": []
            },
            {
              "name": "GraphAnalysis",
              "qualified_name": "GraphAnalysis",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GraphAnalysis = struct",
              "anchor": "graph-analysis",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-analysis",
              "source_path": "src/compute/graph.zig",
              "source_line": 265,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L265",
              "doc": {
                "summary": "Computed summary of the graph structure used by visualization and debugging tools.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Computed summary of the graph structure used by visualization and debugging tools."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "GraphAnalysis.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *GraphAnalysis) void",
                  "anchor": "graph-analysis-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-analysis-deinit",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 315,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L315",
                  "doc": {
                    "summary": "Release the arrays allocated for the analysis result.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph analysis to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the arrays allocated for the analysis result."
                  }
                }
              ]
            },
            {
              "name": "Graph",
              "qualified_name": "Graph",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Graph = struct",
              "anchor": "graph",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph",
              "source_path": "src/compute/graph.zig",
              "source_line": 408,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L408",
              "doc": {
                "summary": "Static compute graph for a transformer layer or full decode pass.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Static compute graph for a transformer layer or full decode pass."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Graph.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, name: []const u8) Graph",
                  "anchor": "graph-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-init",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 424,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L424",
                  "doc": {
                    "summary": "Initialize an empty graph with a human-readable name.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator used for node storage."
                      },
                      {
                        "name": "name",
                        "description": "Debug name for logging and diagnostics."
                      }
                    ],
                    "returns": "A graph ready to accept nodes and dependencies.",
                    "notes": [],
                    "raw": "Initialize an empty graph with a human-readable name."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Graph.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Graph) void",
                  "anchor": "graph-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-deinit",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 433,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L433",
                  "doc": {
                    "summary": "Release all graph nodes owned by the graph.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release all graph nodes owned by the graph."
                  }
                },
                {
                  "name": "addNode",
                  "qualified_name": "Graph.addNode",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn addNode(self: *Graph, op: OpType, name: []const u8) !u32",
                  "anchor": "graph-add-node",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-add-node",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 445,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L445",
                  "doc": {
                    "summary": "Append a node to the graph and assign it the next dense node ID.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to append to."
                      },
                      {
                        "name": "op",
                        "description": "Operation kind represented by the new node."
                      },
                      {
                        "name": "name",
                        "description": "Human-readable node label used in logs and diagnostics."
                      }
                    ],
                    "returns": "The node ID assigned to the appended node.",
                    "notes": [
                      "IDs are stable for the lifetime of the graph and match insertion order."
                    ],
                    "raw": "Append a node to the graph and assign it the next dense node ID."
                  }
                },
                {
                  "name": "setInputs",
                  "qualified_name": "Graph.setInputs",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setInputs(self: *Graph, node_id: u32, inputs: []const u32) void",
                  "anchor": "graph-set-inputs",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-inputs",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 479,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L479",
                  "doc": {
                    "summary": "Set the input buffer table indices consumed by a node.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph containing the node to update."
                      },
                      {
                        "name": "node_id",
                        "description": "ID of the node whose inputs should be overwritten."
                      },
                      {
                        "name": "inputs",
                        "description": "Buffer table indices consumed in shader binding order."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "The slice is copied into the node's fixed-size input array."
                    ],
                    "raw": "Set the input buffer table indices consumed by a node."
                  }
                },
                {
                  "name": "setOutput",
                  "qualified_name": "Graph.setOutput",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setOutput(self: *Graph, node_id: u32, output: u32) void",
                  "anchor": "graph-set-output",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-output",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 491,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L491",
                  "doc": {
                    "summary": "Set the output buffer table index produced by a node.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph containing the node to update."
                      },
                      {
                        "name": "node_id",
                        "description": "ID of the node whose output should be overwritten."
                      },
                      {
                        "name": "output",
                        "description": "Buffer table index produced by the node."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Set the output buffer table index produced by a node."
                  }
                },
                {
                  "name": "setWorkgroups",
                  "qualified_name": "Graph.setWorkgroups",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setWorkgroups(self: *Graph, node_id: u32, x: u32, y: u32, z: u32) void",
                  "anchor": "graph-set-workgroups",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-workgroups",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 501,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L501",
                  "doc": {
                    "summary": "Set the workgroup dimensions that should be used when dispatching a node.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph containing the node to update."
                      },
                      {
                        "name": "node_id",
                        "description": "ID of the node whose dispatch dimensions should be overwritten."
                      },
                      {
                        "name": "x",
                        "description": "Workgroup count in the X dimension."
                      },
                      {
                        "name": "y",
                        "description": "Workgroup count in the Y dimension."
                      },
                      {
                        "name": "z",
                        "description": "Workgroup count in the Z dimension."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Set the workgroup dimensions that should be used when dispatching a node."
                  }
                },
                {
                  "name": "setLayerIndex",
                  "qualified_name": "Graph.setLayerIndex",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setLayerIndex(self: *Graph, node_id: u32, layer_index: ?u32) void",
                  "anchor": "graph-set-layer-index",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-layer-index",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 506,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L506",
                  "doc": {
                    "summary": "Assign a transformer layer index to a node for per-layer diagnostics.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Assign a transformer layer index to a node for per-layer diagnostics."
                  }
                },
                {
                  "name": "setExecDomain",
                  "qualified_name": "Graph.setExecDomain",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setExecDomain(self: *Graph, node_id: u32, domain: ExecDomain) void",
                  "anchor": "graph-set-exec-domain",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-exec-domain",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 511,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L511",
                  "doc": {
                    "summary": "Override the execution domain for a node (defaults to `gpu_compute`).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Override the execution domain for a node (defaults to `gpu_compute`)."
                  }
                },
                {
                  "name": "setThreadsPerWorkgroup",
                  "qualified_name": "Graph.setThreadsPerWorkgroup",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setThreadsPerWorkgroup(self: *Graph, node_id: u32, threads_per_workgroup: u32) void",
                  "anchor": "graph-set-threads-per-workgroup",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-threads-per-workgroup",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 516,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L516",
                  "doc": {
                    "summary": "Set the number of threads per workgroup for occupancy estimates.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Set the number of threads per workgroup for occupancy estimates."
                  }
                },
                {
                  "name": "setCostEstimate",
                  "qualified_name": "Graph.setCostEstimate",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setCostEstimate(self: *Graph, node_id: u32, read_bytes: u64, write_bytes: u64, weight_bytes: u64, flops: u64) void",
                  "anchor": "graph-set-cost-estimate",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-cost-estimate",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 527,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L527",
                  "doc": {
                    "summary": "Attach byte-traffic and FLOP cost estimates used by the bottleneck heuristics.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph containing the node to update."
                      },
                      {
                        "name": "node_id",
                        "description": "ID of the node whose cost estimates should be overwritten."
                      },
                      {
                        "name": "read_bytes",
                        "description": "Estimated activation bytes read per dispatch."
                      },
                      {
                        "name": "write_bytes",
                        "description": "Estimated bytes written per dispatch."
                      },
                      {
                        "name": "weight_bytes",
                        "description": "Estimated weight/tensor payload bytes streamed per dispatch."
                      },
                      {
                        "name": "flops",
                        "description": "Approximate floating-point operations performed per dispatch."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Attach byte-traffic and FLOP cost estimates used by the bottleneck heuristics."
                  }
                },
                {
                  "name": "setHostSync",
                  "qualified_name": "Graph.setHostSync",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setHostSync(self: *Graph, node_id: u32, requires_host_sync: bool) void",
                  "anchor": "graph-set-host-sync",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-host-sync",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 536,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L536",
                  "doc": {
                    "summary": "Mark whether a node requires host-visible synchronization or readback.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Mark whether a node requires host-visible synchronization or readback."
                  }
                },
                {
                  "name": "setNote",
                  "qualified_name": "Graph.setNote",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setNote(self: *Graph, node_id: u32, note: ?[]const u8) void",
                  "anchor": "graph-set-note",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-note",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 541,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L541",
                  "doc": {
                    "summary": "Attach an optional static diagnostic note to a node.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Attach an optional static diagnostic note to a node."
                  }
                },
                {
                  "name": "setAssumedDecodeSeqLen",
                  "qualified_name": "Graph.setAssumedDecodeSeqLen",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setAssumedDecodeSeqLen(self: *Graph, assumed_decode_seq_len: u32) void",
                  "anchor": "graph-set-assumed-decode-seq-len",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-assumed-decode-seq-len",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 546,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L546",
                  "doc": {
                    "summary": "Record the sequence length assumed when building decode-time cost estimates.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record the sequence length assumed when building decode-time cost estimates."
                  }
                },
                {
                  "name": "setHardwareContext",
                  "qualified_name": "Graph.setHardwareContext",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setHardwareContext(self: *Graph, hardware: HardwareInfo) void",
                  "anchor": "graph-set-hardware-context",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-set-hardware-context",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 551,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L551",
                  "doc": {
                    "summary": "Provide hardware parameters used by occupancy and bandwidth heuristics.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Provide hardware parameters used by occupancy and bandwidth heuristics."
                  }
                },
                {
                  "name": "addDependency",
                  "qualified_name": "Graph.addDependency",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn addDependency(self: *Graph, node_id: u32, depends_on: u32) void",
                  "anchor": "graph-add-dependency",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-add-dependency",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 560,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L560",
                  "doc": {
                    "summary": "Declare that one node must execute after another.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph containing both nodes."
                      },
                      {
                        "name": "node_id",
                        "description": "Node that depends on `depends_on`."
                      },
                      {
                        "name": "depends_on",
                        "description": "Node that must run first."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Cycles are not rejected here; `topologicalOrder()` detects them later."
                    ],
                    "raw": "Declare that one node must execute after another."
                  }
                },
                {
                  "name": "topologicalOrder",
                  "qualified_name": "Graph.topologicalOrder",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn topologicalOrder(self: *const Graph, allocator: std.mem.Allocator) ![]u32",
                  "anchor": "graph-topological-order",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-topological-order",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 570,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L570",
                  "doc": {
                    "summary": "Compute a valid execution order for the current dependency graph.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to sort."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary in-degree tracking and the returned order slice."
                      }
                    ],
                    "returns": "Node IDs in a valid execution order, or `error.CyclicDependency` when the graph contains a cycle.",
                    "notes": [],
                    "raw": "Compute a valid execution order for the current dependency graph."
                  }
                },
                {
                  "name": "nodeCount",
                  "qualified_name": "Graph.nodeCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn nodeCount(self: *const Graph) usize",
                  "anchor": "graph-node-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-node-count",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 625,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L625",
                  "doc": {
                    "summary": "Return the number of nodes currently stored in the graph.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to inspect."
                      }
                    ],
                    "returns": "The number of appended nodes.",
                    "notes": [],
                    "raw": "Return the number of nodes currently stored in the graph."
                  }
                },
                {
                  "name": "analyze",
                  "qualified_name": "Graph.analyze",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn analyze(self: *const Graph, allocator: std.mem.Allocator) !GraphAnalysis",
                  "anchor": "graph-analyze",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-analyze",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 633,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L633",
                  "doc": {
                    "summary": "Analyze dependency structure for visualization and optimization work.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to inspect."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for the returned analysis arrays."
                      }
                    ],
                    "returns": "A GraphAnalysis containing op counts, edges, node depths, and the longest dependency chain.",
                    "notes": [],
                    "raw": "Analyze dependency structure for visualization and optimization work."
                  }
                },
                {
                  "name": "writeJsonReport",
                  "qualified_name": "Graph.writeJsonReport",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeJsonReport(self: *const Graph, writer: *std.Io.Writer, allocator: std.mem.Allocator) !void",
                  "anchor": "graph-write-json-report",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-write-json-report",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 944,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L944",
                  "doc": {
                    "summary": "Serialize a graph-analysis JSON payload suitable for custom viewers and scripts.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to inspect and serialize."
                      },
                      {
                        "name": "writer",
                        "description": "Destination writer for the JSON payload."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary analysis storage."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Serialize a graph-analysis JSON payload suitable for custom viewers and scripts."
                  }
                },
                {
                  "name": "writeDot",
                  "qualified_name": "Graph.writeDot",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeDot(self: *const Graph, writer: *std.Io.Writer, allocator: std.mem.Allocator) !void",
                  "anchor": "graph-write-dot",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-write-dot",
                  "source_path": "src/compute/graph.zig",
                  "source_line": 979,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/graph.zig#L979",
                  "doc": {
                    "summary": "Serialize the graph as Graphviz DOT for quick local rendering.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Graph to inspect and serialize."
                      },
                      {
                        "name": "writer",
                        "description": "Destination writer for the DOT payload."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary analysis storage."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Serialize the graph as Graphviz DOT for quick local rendering."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "architecture",
          "title": "Architecture",
          "section": "Decode Planning",
          "summary": "Build static decode graphs for the supported model families.",
          "overview": [
            "These graphs describe the logical order of decode-time operations so runtime code can bind buffers and record compute work against a stable structure."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/architecture/",
          "source_path": "src/model/architecture.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/architecture.zig#L174",
          "counts": {
            "code_lines": 995,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "buildDecodeGraph",
              "qualified_name": "buildDecodeGraph",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn buildDecodeGraph(config: *const ModelConfig, allocator: std.mem.Allocator) !Graph",
              "anchor": "build-decode-graph",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/architecture/#build-decode-graph",
              "source_path": "src/model/architecture.zig",
              "source_line": 174,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/architecture.zig#L174",
              "doc": {
                "summary": "Build a compute graph for a single transformer decode step.",
                "description": [
                  "This creates the graph structure; actual buffer bindings are set at runtime."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Normalized model dimensions and architecture metadata."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for graph storage."
                  }
                ],
                "returns": "A Graph describing the decode-time op order for the selected architecture.",
                "notes": [],
                "raw": "Build a compute graph for a single transformer decode step.\nThis creates the graph structure; actual buffer bindings are set at runtime."
              },
              "members": []
            },
            {
              "name": "buildDecodeGraphDetailed",
              "qualified_name": "buildDecodeGraphDetailed",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn buildDecodeGraphDetailed(config: *const ModelConfig, allocator: std.mem.Allocator, gf: ?*const gguf.GGUFFile) !Graph",
              "anchor": "build-decode-graph-detailed",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/architecture/#build-decode-graph-detailed",
              "source_path": "src/model/architecture.zig",
              "source_line": 186,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/architecture.zig#L186",
              "doc": {
                "summary": "Build a compute graph with per-op weight-size annotations derived from a GGUF file.",
                "description": [
                  "Dispatches to the appropriate architecture-specific builder based on `config.architecture`. from it instead of using float-size approximations."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Normalized model dimensions and architecture metadata."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for graph storage."
                  },
                  {
                    "name": "gf",
                    "description": "Optional parsed GGUF file; when non-null, actual tensor byte sizes are read"
                  }
                ],
                "returns": "A Graph describing the decode-time op order for the selected architecture.",
                "notes": [
                  "Returns `error.UnsupportedArchitecture` if `config.architecture` is `.unknown`."
                ],
                "raw": "Build a compute graph with per-op weight-size annotations derived from a GGUF file.\nDispatches to the appropriate architecture-specific builder based on `config.architecture`.\nfrom it instead of using float-size approximations."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "graph",
          "title": "Graph",
          "section": "Decode Planning",
          "summary": "Shape-static ZINC_RT IR graph builder.",
          "overview": [
            "Graphs contain logical buffers and opcode nodes before any tier lowers them into packets, shaders, or pure Zig calls."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/",
          "source_path": "src/zinc_rt/ir/graph.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L10",
          "counts": {
            "code_lines": 79,
            "exports": 6,
            "methods": 7,
            "symbols": 13
          },
          "symbols": [
            {
              "name": "BufferId",
              "qualified_name": "BufferId",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const BufferId = u32",
              "anchor": "buffer-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#buffer-id",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L10",
              "doc": {
                "summary": "Dense index identifying a logical buffer inside a Graph.",
                "description": [
                  "Buffer ids are assigned sequentially by `Graph.addBuffer` starting at 0."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Dense index identifying a logical buffer inside a Graph.\nBuffer ids are assigned sequentially by `Graph.addBuffer` starting at 0."
              },
              "members": []
            },
            {
              "name": "NodeId",
              "qualified_name": "NodeId",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const NodeId = u32",
              "anchor": "node-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#node-id",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L14",
              "doc": {
                "summary": "Dense index identifying a node (opcode invocation) inside a Graph.",
                "description": [
                  "Node ids are assigned in insertion order by `Graph.addNode`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Dense index identifying a node (opcode invocation) inside a Graph.\nNode ids are assigned in insertion order by `Graph.addNode`."
              },
              "members": []
            },
            {
              "name": "max_bindings",
              "qualified_name": "max_bindings",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const max_bindings = 8",
              "anchor": "max-bindings",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#max-bindings",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L18",
              "doc": {
                "summary": "Maximum number of input or output buffers a single node may bind.",
                "description": [
                  "Picked to keep `BindingList` inline-storable without heap allocation."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Maximum number of input or output buffers a single node may bind.\nPicked to keep `BindingList` inline-storable without heap allocation."
              },
              "members": []
            },
            {
              "name": "BindingList",
              "qualified_name": "BindingList",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BindingList = struct",
              "anchor": "binding-list",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#binding-list",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 23,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L23",
              "doc": {
                "summary": "Fixed-capacity list of buffer ids bound to one side of a node.",
                "description": [
                  "Stores up to `max_bindings` entries inline so a `Node` stays POD and trivially copyable through the planner."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fixed-capacity list of buffer ids bound to one side of a node.\nStores up to `max_bindings` entries inline so a `Node` stays POD and\ntrivially copyable through the planner."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "BindingList.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(values: []const BufferId) !BindingList",
                  "anchor": "binding-list-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#binding-list-init",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 31,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L31",
                  "doc": {
                    "summary": "Build a binding list from a slice of buffer ids.",
                    "description": [],
                    "params": [
                      {
                        "name": "values",
                        "description": "Buffer ids to copy; must contain at most `max_bindings`."
                      }
                    ],
                    "returns": "A fully populated `BindingList`.",
                    "notes": [
                      "Returns `error.TooManyBindings` when `values.len > max_bindings`."
                    ],
                    "raw": "Build a binding list from a slice of buffer ids."
                  }
                },
                {
                  "name": "slice",
                  "qualified_name": "BindingList.slice",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slice(self: *const BindingList) []const BufferId",
                  "anchor": "binding-list-slice",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#binding-list-slice",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 43,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L43",
                  "doc": {
                    "summary": "View the populated prefix of the binding list as a slice.",
                    "description": [],
                    "params": [],
                    "returns": "The first `self.len` buffer ids, in insertion order.",
                    "notes": [],
                    "raw": "View the populated prefix of the binding list as a slice."
                  }
                }
              ]
            },
            {
              "name": "Node",
              "qualified_name": "Node",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Node = struct",
              "anchor": "node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#node",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 51,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L51",
              "doc": {
                "summary": "Single opcode invocation in the graph.",
                "description": [
                  "Each node references its inputs and outputs by `BufferId`; the opcode itself decides the semantics of those bindings (see `op.Info`)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Single opcode invocation in the graph.\nEach node references its inputs and outputs by `BufferId`; the opcode\nitself decides the semantics of those bindings (see `op.Info`)."
              },
              "members": []
            },
            {
              "name": "Graph",
              "qualified_name": "Graph",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Graph = struct",
              "anchor": "graph",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph",
              "source_path": "src/zinc_rt/ir/graph.zig",
              "source_line": 61,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L61",
              "doc": {
                "summary": "Shape-static ZINC_RT IR graph.",
                "description": [
                  "A graph is a flat list of opcode nodes plus a buffer count; lowering passes turn this representation into T-CPU packets, PM4 indirect buffers, or Metal/Vulkan dispatches without mutating the graph itself."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Shape-static ZINC_RT IR graph.\nA graph is a flat list of opcode nodes plus a buffer count; lowering\npasses turn this representation into T-CPU packets, PM4 indirect buffers,\nor Metal/Vulkan dispatches without mutating the graph itself."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Graph.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator) Graph",
                  "anchor": "graph-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-init",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 70,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L70",
                  "doc": {
                    "summary": "Create an empty graph backed by `allocator`.",
                    "description": [
                      "tracked as a plain counter and require no per-buffer heap allocation."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Retained for growing the node array; buffer ids are"
                      }
                    ],
                    "returns": "A zero-buffer, zero-node graph ready for `addBuffer`/`addNode`.",
                    "notes": [],
                    "raw": "Create an empty graph backed by `allocator`.\ntracked as a plain counter and require no per-buffer heap allocation."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Graph.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Graph) void",
                  "anchor": "graph-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-deinit",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 76,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L76",
                  "doc": {
                    "summary": "Release the node array and poison the graph value.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [
                      "Buffer ids are integers and require no per-buffer release."
                    ],
                    "raw": "Release the node array and poison the graph value."
                  }
                },
                {
                  "name": "addBuffer",
                  "qualified_name": "Graph.addBuffer",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn addBuffer(self: *Graph) BufferId",
                  "anchor": "graph-add-buffer",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-add-buffer",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 83,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L83",
                  "doc": {
                    "summary": "Reserve a new logical buffer and return its id.",
                    "description": [],
                    "params": [],
                    "returns": "The freshly allocated `BufferId`, equal to the previous buffer count.",
                    "notes": [],
                    "raw": "Reserve a new logical buffer and return its id."
                  }
                },
                {
                  "name": "addNode",
                  "qualified_name": "Graph.addNode",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn addNode( self: *Graph, opcode: op.Opcode, inputs: []const BufferId, outputs: []const BufferId, ) !NodeId",
                  "anchor": "graph-add-node",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-add-node",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 95,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L95",
                  "doc": {
                    "summary": "Append an opcode node with the given input and output bindings.",
                    "description": [],
                    "params": [
                      {
                        "name": "opcode",
                        "description": "Opcode this node executes."
                      },
                      {
                        "name": "inputs",
                        "description": "Buffer ids consumed by the node, in opcode-defined order."
                      },
                      {
                        "name": "outputs",
                        "description": "Buffer ids produced by the node, in opcode-defined order."
                      }
                    ],
                    "returns": "The `NodeId` of the newly appended node.",
                    "notes": [
                      "Fails with `error.TooManyBindings` when either slice exceeds `max_bindings`."
                    ],
                    "raw": "Append an opcode node with the given input and output bindings."
                  }
                },
                {
                  "name": "verify",
                  "qualified_name": "Graph.verify",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn verify(self: *const Graph) !void",
                  "anchor": "graph-verify",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/graph/#graph-verify",
                  "source_path": "src/zinc_rt/ir/graph.zig",
                  "source_line": 114,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/graph.zig#L114",
                  "doc": {
                    "summary": "Structural sanity check: graph is non-empty, all bindings resolve, and every non-barrier/stream_out node produces at least one output.",
                    "description": [
                      "`error.UnknownOutputBuffer`, or `error.NodeWithoutOutput` on failure."
                    ],
                    "params": [],
                    "returns": "`error.EmptyGraph`, `error.UnknownInputBuffer`,",
                    "notes": [],
                    "raw": "Structural sanity check: graph is non-empty, all bindings resolve,\nand every non-barrier/stream_out node produces at least one output.\n`error.UnknownOutputBuffer`, or `error.NodeWithoutOutput` on failure."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "op",
          "title": "Op",
          "section": "Decode Planning",
          "summary": "ZINC_RT IR opcode definitions.",
          "overview": [
            "This table mirrors Appendix B of the design and gives each opcode stable metadata for verification, lowering, and T-CPU dispatch."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/",
          "source_path": "src/zinc_rt/ir/op.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L11",
          "counts": {
            "code_lines": 99,
            "exports": 8,
            "methods": 0,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "Stage",
              "qualified_name": "Stage",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Stage = enum",
              "anchor": "stage",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#stage",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L11",
              "doc": {
                "summary": "Which inference stage an opcode participates in.",
                "description": [
                  "`decode` ops run during single-token autoregressive steps, `prefill` ops run during the batched prompt-ingestion phase, and `both` ops are shared between the two paths (e.g. RMS norm, RoPE)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Which inference stage an opcode participates in.\n`decode` ops run during single-token autoregressive steps, `prefill`\nops run during the batched prompt-ingestion phase, and `both` ops are\nshared between the two paths (e.g. RMS norm, RoPE)."
              },
              "members": []
            },
            {
              "name": "Milestone",
              "qualified_name": "Milestone",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Milestone = enum",
              "anchor": "milestone",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#milestone",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L20",
              "doc": {
                "summary": "Roadmap milestone in which the opcode becomes mandatory.",
                "description": [
                  "`m0` is the minimum viable decode set; later milestones add fused kernels, prefill batching, request-state I/O, and verification ops."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Roadmap milestone in which the opcode becomes mandatory.\n`m0` is the minimum viable decode set; later milestones add fused\nkernels, prefill batching, request-state I/O, and verification ops."
              },
              "members": []
            },
            {
              "name": "Opcode",
              "qualified_name": "Opcode",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Opcode = enum(u8)",
              "anchor": "opcode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#opcode",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 31,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L31",
              "doc": {
                "summary": "ZINC_RT IR opcode table.",
                "description": [
                  "Each variant maps onto Appendix B of the runtime design; metadata such as the human-readable name, stage, and milestone live in `info`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "ZINC_RT IR opcode table.\nEach variant maps onto Appendix B of the runtime design; metadata such\nas the human-readable name, stage, and milestone live in `info`."
              },
              "members": []
            },
            {
              "name": "Info",
              "qualified_name": "Info",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Info = struct",
              "anchor": "info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#info",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 65,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L65",
              "doc": {
                "summary": "Static metadata for an opcode.",
                "description": [
                  "Pairs the IR enum with its canonical printable name, the stage it targets, and the milestone in which it must be implemented."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Static metadata for an opcode.\nPairs the IR enum with its canonical printable name, the stage it\ntargets, and the milestone in which it must be implemented."
              },
              "members": []
            },
            {
              "name": "info",
              "qualified_name": "info",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn info(opcode: Opcode) Info",
              "anchor": "info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#info",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 75,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L75",
              "doc": {
                "summary": "Look up the static metadata record for an opcode.",
                "description": [
                  "never traps at runtime."
                ],
                "params": [
                  {
                    "name": "opcode",
                    "description": "IR opcode to describe."
                  }
                ],
                "returns": "The matching `Info` entry; the switch is exhaustive so this",
                "notes": [],
                "raw": "Look up the static metadata record for an opcode.\nnever traps at runtime."
              },
              "members": []
            },
            {
              "name": "name",
              "qualified_name": "name",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn name(opcode: Opcode) []const u8",
              "anchor": "name",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#name",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 111,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L111",
              "doc": {
                "summary": "Canonical printable name for an opcode (e.g.",
                "description": [
                  "`\"FLASH_ATTN\"`)."
                ],
                "params": [
                  {
                    "name": "opcode",
                    "description": "IR opcode to name."
                  }
                ],
                "returns": "The `Info.name` string, suitable for logging and golden traces.",
                "notes": [],
                "raw": "Canonical printable name for an opcode (e.g. `\"FLASH_ATTN\"`)."
              },
              "members": []
            },
            {
              "name": "fromName",
              "qualified_name": "fromName",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn fromName(value: []const u8) ?Opcode",
              "anchor": "from-name",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#from-name",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 121,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L121",
              "doc": {
                "summary": "Parse an opcode from its canonical name or Zig identifier.",
                "description": [
                  "Accepts either the printable `Info.name` (case-sensitive) or the Zig enum field name (case-insensitive), so both `\"FLASH_ATTN\"` and `\"flash_attn\"` resolve to `Opcode.flash_attn`."
                ],
                "params": [
                  {
                    "name": "value",
                    "description": "Candidate opcode spelling."
                  }
                ],
                "returns": "The matching opcode, or `null` when no variant matches.",
                "notes": [],
                "raw": "Parse an opcode from its canonical name or Zig identifier.\nAccepts either the printable `Info.name` (case-sensitive) or the Zig\nenum field name (case-insensitive), so both `\"FLASH_ATTN\"` and\n`\"flash_attn\"` resolve to `Opcode.flash_attn`."
              },
              "members": []
            },
            {
              "name": "isM0",
              "qualified_name": "isM0",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn isM0(opcode: Opcode) bool",
              "anchor": "is-m0",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/op/#is-m0",
              "source_path": "src/zinc_rt/ir/op.zig",
              "source_line": 134,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/op.zig#L134",
              "doc": {
                "summary": "Check whether an opcode is part of the M0 minimum-viable decode set.",
                "description": [],
                "params": [
                  {
                    "name": "opcode",
                    "description": "IR opcode to query."
                  }
                ],
                "returns": "`true` when `info(opcode).milestone == .m0`.",
                "notes": [],
                "raw": "Check whether an opcode is part of the M0 minimum-viable decode set."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "verify",
          "title": "Verify",
          "section": "Decode Planning",
          "summary": "ZINC_RT IR verifier entrypoints.",
          "overview": [
            "Verification stays separate from graph construction so future passes can reject malformed shapes and bindings before any backend executes them."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/verify/",
          "source_path": "src/zinc_rt/ir/verify.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/verify.zig#L13",
          "counts": {
            "code_lines": 4,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "graph",
              "qualified_name": "graph",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn graph(ir: *const graph_mod.Graph) !void",
              "anchor": "graph",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/verify/#graph",
              "source_path": "src/zinc_rt/ir/verify.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ir/verify.zig#L13",
              "doc": {
                "summary": "Run structural verification over an IR graph.",
                "description": [
                  "Thin wrapper around `Graph.verify` so callers depend on this module rather than reaching into the graph type directly; future passes will add shape and type checks here without touching graph construction."
                ],
                "params": [
                  {
                    "name": "ir",
                    "description": "Graph to inspect; not mutated."
                  }
                ],
                "returns": "Propagates any verification error from `Graph.verify`.",
                "notes": [],
                "raw": "Run structural verification over an IR graph.\nThin wrapper around `Graph.verify` so callers depend on this module\nrather than reaching into the graph type directly; future passes will\nadd shape and type checks here without touching graph construction."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "inference-runtime",
      "title": "Inference Runtime",
      "description": "Decode state, pipeline ownership, command recording, and token sampling inside the active inference loop.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#inference-runtime",
      "module_count": 35,
      "symbol_count": 462,
      "modules": [
        {
          "slug": "bench-hot-decode",
          "title": "Bench Hot Decode",
          "section": "Inference Runtime",
          "summary": "Hot-path decode kernel microbenchmarks.",
          "overview": [
            "Measures per-dispatch GPU latency, memory bandwidth, and VRAM utilisation for individual compute kernels (DMMV, SSM delta-net) in isolation. Run via `zig build hot-bench -Doptimize=ReleaseFast`."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-hot-decode/",
          "source_path": "src/bench_hot_decode.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_hot_decode.zig#L1006",
          "counts": {
            "code_lines": 1003,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-hot-decode/#main",
              "source_path": "src/bench_hot_decode.zig",
              "source_line": 1006,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_hot_decode.zig#L1006",
              "doc": {
                "summary": "Run the hot-decode microbenchmark suite against the selected model and kernels.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Run the hot-decode microbenchmark suite against the selected model and kernels."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "bench-support",
          "title": "Bench Support",
          "section": "Inference Runtime",
          "summary": "Shared helpers for benchmark and standalone runner entrypoints.",
          "overview": [
            "This module re-exports the Metal runtime pieces that the benchmark tools need and centralizes the GPU-process-lock error path so the small bench binaries do not duplicate server/runtime boilerplate."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/",
          "source_path": "src/bench_support.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L10",
          "counts": {
            "code_lines": 26,
            "exports": 12,
            "methods": 0,
            "symbols": 12
          },
          "symbols": [
            {
              "name": "metal_device",
              "qualified_name": "metal_device",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_device = @import(\"metal/device.zig\")",
              "anchor": "metal-device",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-device",
              "source_path": "src/bench_support.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L10",
              "doc": {
                "summary": "Metal device initialization and capability queries (MTLDevice wrapper).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal device initialization and capability queries (MTLDevice wrapper)."
              },
              "members": []
            },
            {
              "name": "metal_loader",
              "qualified_name": "metal_loader",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_loader = @import(\"model/loader_metal.zig\")",
              "anchor": "metal-loader",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-loader",
              "source_path": "src/bench_support.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L12",
              "doc": {
                "summary": "Model loader that maps GGUF weights onto Metal buffers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Model loader that maps GGUF weights onto Metal buffers."
              },
              "members": []
            },
            {
              "name": "metal_buffer",
              "qualified_name": "metal_buffer",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_buffer = @import(\"metal/buffer.zig\")",
              "anchor": "metal-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-buffer",
              "source_path": "src/bench_support.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L14",
              "doc": {
                "summary": "Metal buffer allocation and management utilities.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal buffer allocation and management utilities."
              },
              "members": []
            },
            {
              "name": "metal_command",
              "qualified_name": "metal_command",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_command = @import(\"metal/command.zig\")",
              "anchor": "metal-command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-command",
              "source_path": "src/bench_support.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L16",
              "doc": {
                "summary": "Metal command queue and command buffer submission helpers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal command queue and command buffer submission helpers."
              },
              "members": []
            },
            {
              "name": "kernel_timing",
              "qualified_name": "kernel_timing",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const kernel_timing = @import(\"metal/kernel_timing.zig\")",
              "anchor": "kernel-timing",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#kernel-timing",
              "source_path": "src/bench_support.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L18",
              "doc": {
                "summary": "Per-kernel Metal dispatch timing probe for profiling individual GPU kernels.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-kernel Metal dispatch timing probe for profiling individual GPU kernels."
              },
              "members": []
            },
            {
              "name": "metal_pipeline",
              "qualified_name": "metal_pipeline",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_pipeline = @import(\"metal/pipeline.zig\")",
              "anchor": "metal-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-pipeline",
              "source_path": "src/bench_support.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L20",
              "doc": {
                "summary": "Metal compute pipeline state cache and compilation helpers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal compute pipeline state cache and compilation helpers."
              },
              "members": []
            },
            {
              "name": "metal_c",
              "qualified_name": "metal_c",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const metal_c = @import(\"metal/c.zig\")",
              "anchor": "metal-c",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#metal-c",
              "source_path": "src/bench_support.zig",
              "source_line": 22,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L22",
              "doc": {
                "summary": "Raw Objective-C/Metal C shim types and bindings.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Raw Objective-C/Metal C shim types and bindings."
              },
              "members": []
            },
            {
              "name": "gguf",
              "qualified_name": "gguf",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const gguf = @import(\"model/gguf.zig\")",
              "anchor": "gguf",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#gguf",
              "source_path": "src/bench_support.zig",
              "source_line": 24,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L24",
              "doc": {
                "summary": "GGUF file parser for reading quantized model weights and metadata.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GGUF file parser for reading quantized model weights and metadata."
              },
              "members": []
            },
            {
              "name": "tokenizer_mod",
              "qualified_name": "tokenizer_mod",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const tokenizer_mod = @import(\"model/tokenizer.zig\")",
              "anchor": "tokenizer-mod",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#tokenizer-mod",
              "source_path": "src/bench_support.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L26",
              "doc": {
                "summary": "BPE tokenizer encode and decode for text pre/post-processing.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "BPE tokenizer encode and decode for text pre/post-processing."
              },
              "members": []
            },
            {
              "name": "forward_metal",
              "qualified_name": "forward_metal",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const forward_metal = @import(\"compute/forward_metal.zig\")",
              "anchor": "forward-metal",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#forward-metal",
              "source_path": "src/bench_support.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L28",
              "doc": {
                "summary": "Metal forward-pass runtime that runs the full model inference graph.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal forward-pass runtime that runs the full model inference graph."
              },
              "members": []
            },
            {
              "name": "process_lock",
              "qualified_name": "process_lock",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const process_lock = @import(\"gpu/process_lock.zig\")",
              "anchor": "process-lock",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#process-lock",
              "source_path": "src/bench_support.zig",
              "source_line": 30,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L30",
              "doc": {
                "summary": "Cross-process GPU ownership lock preventing two zinc processes from sharing a GPU.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Cross-process GPU ownership lock preventing two zinc processes from sharing a GPU."
              },
              "members": []
            },
            {
              "name": "reportGpuProcessLockError",
              "qualified_name": "reportGpuProcessLockError",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn reportGpuProcessLockError(err: anyerror, backend: process_lock.Backend, device_index: u32) noreturn",
              "anchor": "report-gpu-process-lock-error",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/bench-support/#report-gpu-process-lock-error",
              "source_path": "src/bench_support.zig",
              "source_line": 42,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/bench_support.zig#L42",
              "doc": {
                "summary": "Log a user-facing GPU-process-lock error and terminate the benchmark binary.",
                "description": [
                  "Prints a human-readable message to stderr explaining why the lock could not be acquired, then calls `std.process.exit(1)`.",
                  "dedicated \"stop the other instance\" message; all other errors fall back to a generic failure message."
                ],
                "params": [
                  {
                    "name": "err",
                    "description": "The lock-acquisition error; `error.GpuAlreadyReserved` gets a"
                  },
                  {
                    "name": "backend",
                    "description": "The GPU backend whose lock failed (used in the log message)."
                  },
                  {
                    "name": "device_index",
                    "description": "Index of the GPU device that could not be locked (used in the log message)."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Log a user-facing GPU-process-lock error and terminate the benchmark binary.\n\nPrints a human-readable message to stderr explaining why the lock could not\nbe acquired, then calls `std.process.exit(1)`.\n\ndedicated \"stop the other instance\" message; all other errors\nfall back to a generic failure message."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "forward-cuda-gemma",
          "title": "Forward Cuda Gemma",
          "section": "Inference Runtime",
          "summary": "CUDA forward pass for the dense gemma4 transformer (Gemma 4 31B-it).",
          "overview": [
            "Effort 22 — completes the 5/5 catalog on the 4090. Separate from forward_cuda.zig (qwen35/qwen36 hybrid-SSM family) because gemma4 is a plain transformer with a different per-layer geometry: sliding-window attention on a period-6 pattern (5 SWA + 1 full), per-layer head dims (256 SWA / 512 full) and KV-head counts (16 SWA / 4 full), per-head Q/K RMS norm + per-head V RMS normalize, four norms per layer (pre/post attn + pre/post ffn), GeGLU FFN, a learned per-layer output scale, scaled token embeddings, and a tied LM head.",
            "Norm convention: the gemma RMSNorm `(1 + weight)` offset is baked into the GGUF weights at conversion (confirmed: attn_q_norm ≈ 1.0234), so every gemma norm reuses the standard `rms_norm` kernel; V uses `rms_norm_noweight`.",
            "Attention scale: gemma4 sets f_attention_scale = 1.0 (no 1/sqrt(d) scaling). Final-logit soft-cap is monotonic, so it does not change the greedy argmax and is intentionally skipped here (correctness-first bring-up)."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/",
          "source_path": "src/compute/forward_cuda_gemma.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L336",
          "counts": {
            "code_lines": 1738,
            "exports": 1,
            "methods": 15,
            "symbols": 16
          },
          "symbols": [
            {
              "name": "ForwardGemma",
              "qualified_name": "ForwardGemma",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ForwardGemma = struct",
              "anchor": "forward-gemma",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma",
              "source_path": "src/compute/forward_cuda_gemma.zig",
              "source_line": 336,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L336",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ForwardGemma.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, model: *loader.Model, max_ctx: u32) !ForwardGemma",
                  "anchor": "forward-gemma-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-init",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 463,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L463",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ForwardGemma.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ForwardGemma) void",
                  "anchor": "forward-gemma-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-deinit",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 732,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L732",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "decodeStep",
                  "qualified_name": "ForwardGemma.decodeStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeStep(self: *ForwardGemma, token: u32, pos: u32, run_layers: bool) !u32",
                  "anchor": "forward-gemma-decode-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-decode-step",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 770,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L770",
                  "doc": {
                    "summary": "One greedy decode step for `token` at sequence position `pos`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "One greedy decode step for `token` at sequence position `pos`."
                  }
                },
                {
                  "name": "prefillStep",
                  "qualified_name": "ForwardGemma.prefillStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillStep(self: *ForwardGemma, token: u32, pos: u32) !void",
                  "anchor": "forward-gemma-prefill-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-prefill-step",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 824,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L824",
                  "doc": {
                    "summary": "Prefill helper (mirrors ForwardCuda.prefillStep): run every layer to build the KV cache, but SKIP the tail rms_norm + LM head + argmax — a prompt-internal token's logits are never read.",
                    "description": [
                      "Saves the vocab-sized head matvec on T-1 of the T prompt tokens; the MoE gemma model (small active forward, full head) benefits most. Async layer ops drained here; bit-identical generation."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Prefill helper (mirrors ForwardCuda.prefillStep): run every layer to\nbuild the KV cache, but SKIP the tail rms_norm + LM head + argmax — a\nprompt-internal token's logits are never read. Saves the vocab-sized\nhead matvec on T-1 of the T prompt tokens; the MoE gemma model (small\nactive forward, full head) benefits most. Async layer ops drained here;\nbit-identical generation."
                  }
                },
                {
                  "name": "prefillBatched",
                  "qualified_name": "ForwardGemma.prefillBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatched(self: *ForwardGemma, tokens: []const u32) !u32",
                  "anchor": "forward-gemma-prefill-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-prefill-batched",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 861,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L861",
                  "doc": {
                    "summary": "Batched dense-gemma prefill: process ALL T prompt tokens at once, reading each weight ONCE for all tokens via the gemm_*_tiled_v2 register-blocked GEMMs (5.9× over the per-token matvec). Returns the last token's argmax (= the first generated token), exactly like running prefillStep on tokens [0..T-1] then decodeStep on the last. ADDITIVE: builds its own token-major scratch and never touches the single-token decode path.",
                    "description": [
                      "Phase-1 scope is the DENSE gemma-31b (n_experts==0). Phase-2 cycle 1 adds the 26b MoE: its ATTENTION block is the SAME structure as the dense model, so it shares the batched attention path (GEMM Q/K/V/O + batched causal attn + batched norm/RoPE/KV-write) — bit-identical to the per-token attentionLayer. Its routed-expert FFN is still LOOPED per token (the existing single-token moeFfnBlock, fed each token's hidden slice via an alias-swap) because the FFN is position-independent → looping it is output-identical; full batched-expert routing (group T tokens by expert) is a later cycle."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Batched dense-gemma prefill: process ALL T prompt tokens at once, reading\neach weight ONCE for all tokens via the gemm_*_tiled_v2 register-blocked\nGEMMs (5.9× over the per-token matvec). Returns the last token's argmax\n(= the first generated token), exactly like running prefillStep on tokens\n[0..T-1] then decodeStep on the last. ADDITIVE: builds its own token-major\nscratch and never touches the single-token decode path.\n\nPhase-1 scope is the DENSE gemma-31b (n_experts==0). Phase-2 cycle 1 adds\nthe 26b MoE: its ATTENTION block is the SAME structure as the dense model,\nso it shares the batched attention path (GEMM Q/K/V/O + batched causal attn\n+ batched norm/RoPE/KV-write) — bit-identical to the per-token attentionLayer.\nIts routed-expert FFN is still LOOPED per token (the existing single-token\nmoeFfnBlock, fed each token's hidden slice via an alias-swap) because the\nFFN is position-independent → looping it is output-identical; full\nbatched-expert routing (group T tokens by expert) is a later cycle."
                  }
                },
                {
                  "name": "decodeBatch",
                  "qualified_name": "ForwardGemma.decodeBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeBatch(self: *ForwardGemma, tokens: []const u32, positions: []const u32, slots: []const u32, out_tokens: []u32) !void",
                  "anchor": "forward-gemma-decode-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-decode-batch",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 1239,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L1239",
                  "doc": {
                    "summary": "Batched DECODE step (DENSE gemma only): advance B independent sequences by ONE token each in a SINGLE B-row forward. The projections + FFN reuse the batched-prefill GEMM path — `gemmDispatch`/`ffnBlockBatched` read each weight ONCE for all B rows (the launch / weight-bandwidth amortization that makes batching a throughput win). The attention inner (per-head V/Q/K norm + RoPE + KV-write + causal softmax) LOOPS per row through the proven single-token kernels (`rms_norm_rope_qkv` / `gemma_attention`) against each sequence's OWN KV slot at its OWN position — so row b attends over slot `slots[b]`'s history [0..positions[b]] only. Fusing that per-row loop into one batched-seq attention kernel is sub-step 1c (a perf step; the looped form here is already correct for mixed positions). ADDITIVE — the production `decodeStep` / `prefillBatched` paths are untouched.",
                    "description": [
                      "Requires `allocSlotKv(n_slots, slot_ctx)` first, with n_slots > max(slots) and slot_ctx > max(positions). Each sequence b's slot must already hold its KV history for [0..positions[b]-1] (written by prior `decodeBatch` calls — e.g. a per-token B=1 prefill into the slot). Writes b's new K/V at its slot.",
                      "tokens[b] input token for sequence b this step positions[b] sequence b's current position (slot holds [0..pos-1]) slots[b] sequence b's KV slot index out_tokens[b] greedy argmax for sequence b (caller advances pos + feeds back)"
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Batched DECODE step (DENSE gemma only): advance B independent sequences by\nONE token each in a SINGLE B-row forward. The projections + FFN reuse the\nbatched-prefill GEMM path — `gemmDispatch`/`ffnBlockBatched` read each\nweight ONCE for all B rows (the launch / weight-bandwidth amortization that\nmakes batching a throughput win). The attention inner (per-head V/Q/K\nnorm + RoPE + KV-write + causal softmax) LOOPS per row through the proven\nsingle-token kernels (`rms_norm_rope_qkv` / `gemma_attention`) against each\nsequence's OWN KV slot at its OWN position — so row b attends over slot\n`slots[b]`'s history [0..positions[b]] only. Fusing that per-row loop into\none batched-seq attention kernel is sub-step 1c (a perf step; the looped\nform here is already correct for mixed positions). ADDITIVE — the production\n`decodeStep` / `prefillBatched` paths are untouched.\n\nRequires `allocSlotKv(n_slots, slot_ctx)` first, with n_slots > max(slots)\nand slot_ctx > max(positions). Each sequence b's slot must already hold its\nKV history for [0..positions[b]-1] (written by prior `decodeBatch` calls —\ne.g. a per-token B=1 prefill into the slot). Writes b's new K/V at its slot.\n\ntokens[b]     input token for sequence b this step\npositions[b]  sequence b's current position (slot holds [0..pos-1])\nslots[b]      sequence b's KV slot index\nout_tokens[b] greedy argmax for sequence b (caller advances pos + feeds back)"
                  }
                },
                {
                  "name": "allocSlotKv",
                  "qualified_name": "ForwardGemma.allocSlotKv",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn allocSlotKv(self: *ForwardGemma, n_slots: u32, slot_ctx: u32) !void",
                  "anchor": "forward-gemma-alloc-slot-kv",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-alloc-slot-kv",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 1650,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L1650",
                  "doc": {
                    "summary": "Allocate slot-based KV for `n_slots` concurrent sequences of up to `slot_ctx` positions each.",
                    "description": [
                      "ADDITIVE: a fresh per-layer allocation that never aliases or touches the production single-sequence kv_k/kv_v. The batched-decode path (sub-steps 1b/1c) writes/reads it via `slotKvOffsetBytes`; the production decodeStep is unchanged. Idempotent — frees any prior slot KV first. Sub-step 1a only allocates + smoke-tests it."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Allocate slot-based KV for `n_slots` concurrent sequences of up to\n`slot_ctx` positions each. ADDITIVE: a fresh per-layer allocation that\nnever aliases or touches the production single-sequence kv_k/kv_v. The\nbatched-decode path (sub-steps 1b/1c) writes/reads it via\n`slotKvOffsetBytes`; the production decodeStep is unchanged. Idempotent —\nfrees any prior slot KV first. Sub-step 1a only allocates + smoke-tests it."
                  }
                },
                {
                  "name": "freeSlotKv",
                  "qualified_name": "ForwardGemma.freeSlotKv",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn freeSlotKv(self: *ForwardGemma) void",
                  "anchor": "forward-gemma-free-slot-kv",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-free-slot-kv",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 1675,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L1675",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "slotKvOffsetBytes",
                  "qualified_name": "ForwardGemma.slotKvOffsetBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotKvOffsetBytes(self: *const ForwardGemma, L: u32, slot: u32, pos: u32) usize",
                  "anchor": "forward-gemma-slot-kv-offset-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-slot-kv-offset-bytes",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 1709,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L1709",
                  "doc": {
                    "summary": "Byte offset of sequence-slot `slot`'s K/V for position `pos` in layer `L`'s slot KV buffer: (slot*slot_ctx + pos)*kv_dim(L)*sizeof(f32).",
                    "description": [
                      "This is the exact indexing the 1c per-sequence kv-write + slot attention kernels use."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Byte offset of sequence-slot `slot`'s K/V for position `pos` in layer `L`'s\nslot KV buffer: (slot*slot_ctx + pos)*kv_dim(L)*sizeof(f32). This is the\nexact indexing the 1c per-sequence kv-write + slot attention kernels use."
                  }
                },
                {
                  "name": "slotKvSmoke",
                  "qualified_name": "ForwardGemma.slotKvSmoke",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotKvSmoke(self: *ForwardGemma) !bool",
                  "anchor": "forward-gemma-slot-kv-smoke",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-slot-kv-smoke",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 1718,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L1718",
                  "doc": {
                    "summary": "Sub-step 1a plumbing smoke: prove the slot-KV offset arithmetic round-trips and that distinct (slot,pos) pairs map to NON-overlapping device regions.",
                    "description": [
                      "Writes a sentinel into (slot 0, pos 0) and a distinct pattern into the LAST (slot, pos) of layer 0's K cache, reads both back, and checks neither write clobbered the other. Returns true on success. Requires allocSlotKv first."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Sub-step 1a plumbing smoke: prove the slot-KV offset arithmetic round-trips\nand that distinct (slot,pos) pairs map to NON-overlapping device regions.\nWrites a sentinel into (slot 0, pos 0) and a distinct pattern into the LAST\n(slot, pos) of layer 0's K cache, reads both back, and checks neither write\nclobbered the other. Returns true on success. Requires allocSlotKv first."
                  }
                },
                {
                  "name": "attentionLayerPub",
                  "qualified_name": "ForwardGemma.attentionLayerPub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn attentionLayerPub(self: *ForwardGemma, L: u32, pos: u32) !void",
                  "anchor": "forward-gemma-attention-layer-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-attention-layer-pub",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 2487,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L2487",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "ffnLayerPub",
                  "qualified_name": "ForwardGemma.ffnLayerPub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ffnLayerPub(self: *ForwardGemma, L: u32) !void",
                  "anchor": "forward-gemma-ffn-layer-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-ffn-layer-pub",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 2493,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L2493",
                  "doc": {
                    "summary": "FFN block dispatched exactly as decodeStep: routed MoE when this layer carries a router, dense GeGLU otherwise.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "FFN block dispatched exactly as decodeStep: routed MoE when this layer\ncarries a router, dense GeGLU otherwise."
                  }
                },
                {
                  "name": "layerOutScalePub",
                  "qualified_name": "ForwardGemma.layerOutScalePub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn layerOutScalePub(self: *ForwardGemma, L: u32) !void",
                  "anchor": "forward-gemma-layer-out-scale-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-layer-out-scale-pub",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 2501,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L2501",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "readHidden",
                  "qualified_name": "ForwardGemma.readHidden",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn readHidden(self: *ForwardGemma, out: []f32) void",
                  "anchor": "forward-gemma-read-hidden",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-read-hidden",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 2506,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L2506",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "readLogits",
                  "qualified_name": "ForwardGemma.readLogits",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn readLogits(self: *ForwardGemma, out: []f32) void",
                  "anchor": "forward-gemma-read-logits",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda-gemma/#forward-gemma-read-logits",
                  "source_path": "src/compute/forward_cuda_gemma.zig",
                  "source_line": 2509,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda_gemma.zig#L2509",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "forward-cuda",
          "title": "Forward Cuda",
          "section": "Inference Runtime",
          "summary": "CUDA forward pass for the dense `qwen35` hybrid-SSM model (Qwen 3.5 9B).",
          "overview": [
            "M2 bring-up — incremental greedy decode of a single token on NVIDIA. The CUDA backend modules (device/buffer/pipeline/command) and the kernel library (`src/shaders/cuda/kernels.cu`, NVRTC-compiled) are orchestrated here into a real forward pass. Weights upload VERBATIM-quantized (Q4_K/Q5_K/Q6_K/Q8_0 blocks) via loader_cuda and are dequantized inside the DMMV kernels.",
            "Layer schedule (qwen35, full_attention_interval=4): layer L is full attention when ((L+1) % 4 == 0) → L in {3,7,11,15,19,23,27,31}; the other 24 layers are gated-delta-net SSM. Every layer is followed by a SwiGLU FFN block."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/",
          "source_path": "src/compute/forward_cuda.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L504",
          "counts": {
            "code_lines": 2725,
            "exports": 1,
            "methods": 20,
            "symbols": 21
          },
          "symbols": [
            {
              "name": "ForwardCuda",
              "qualified_name": "ForwardCuda",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ForwardCuda = struct",
              "anchor": "forward-cuda",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda",
              "source_path": "src/compute/forward_cuda.zig",
              "source_line": 504,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L504",
              "doc": {
                "summary": "Per-token GPU forward state for qwen35 greedy decode.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-token GPU forward state for qwen35 greedy decode."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ForwardCuda.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, model: *loader.Model, max_ctx: u32) !ForwardCuda",
                  "anchor": "forward-cuda-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-init",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 763,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L763",
                  "doc": {
                    "summary": "Compile kernels, allocate every device buffer, upload inv_freq + sinks, zero the KV cache and SSM state.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Compile kernels, allocate every device buffer, upload inv_freq + sinks,\nzero the KV cache and SSM state."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ForwardCuda.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ForwardCuda) void",
                  "anchor": "forward-cuda-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-deinit",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1098,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1098",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "allocSlotState",
                  "qualified_name": "ForwardCuda.allocSlotState",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn allocSlotState(self: *ForwardCuda, n_slots: u32, slot_ctx: u32) !void",
                  "anchor": "forward-cuda-alloc-slot-state",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-alloc-slot-state",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1155,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1155",
                  "doc": {
                    "summary": "Allocate per-sequence slot state for `n_slots` concurrent sequences, each with up to `slot_ctx` positions.",
                    "description": [
                      "Attn layers get slot KV; ssm layers get per-slot conv + recurrent state (zero-initialised). Additive — production single-sequence buffers are untouched. Re-callable (frees first)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Allocate per-sequence slot state for `n_slots` concurrent sequences, each\nwith up to `slot_ctx` positions. Attn layers get slot KV; ssm layers get\nper-slot conv + recurrent state (zero-initialised). Additive — production\nsingle-sequence buffers are untouched. Re-callable (frees first)."
                  }
                },
                {
                  "name": "freeSlotState",
                  "qualified_name": "ForwardCuda.freeSlotState",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn freeSlotState(self: *ForwardCuda) void",
                  "anchor": "forward-cuda-free-slot-state",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-free-slot-state",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1197,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1197",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "slotKvOffsetBytes",
                  "qualified_name": "ForwardCuda.slotKvOffsetBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotKvOffsetBytes(self: *const ForwardCuda, slot: u32, pos: u32) usize",
                  "anchor": "forward-cuda-slot-kv-offset-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-slot-kv-offset-bytes",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1222,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1222",
                  "doc": {
                    "summary": "Byte offset of slot `slot`'s K/V for position `pos` in attn layer `L`'s slot KV: (slot*slot_ctx + pos)*kv_dim*sizeof(f32).",
                    "description": [
                      "The future per-seq kv-write + slot attention kernels (4b/4c) will use this exact indexing."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Byte offset of slot `slot`'s K/V for position `pos` in attn layer `L`'s slot\nKV: (slot*slot_ctx + pos)*kv_dim*sizeof(f32). The future per-seq kv-write +\nslot attention kernels (4b/4c) will use this exact indexing."
                  }
                },
                {
                  "name": "slotConvOffsetBytes",
                  "qualified_name": "ForwardCuda.slotConvOffsetBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotConvOffsetBytes(self: *const ForwardCuda, slot: u32) usize",
                  "anchor": "forward-cuda-slot-conv-offset-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-slot-conv-offset-bytes",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1226,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1226",
                  "doc": {
                    "summary": "Byte offset of slot `slot`'s conv ring (ssm layer): slot*conv_state_len*f4.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Byte offset of slot `slot`'s conv ring (ssm layer): slot*conv_state_len*f4."
                  }
                },
                {
                  "name": "slotStateOffsetBytes",
                  "qualified_name": "ForwardCuda.slotStateOffsetBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotStateOffsetBytes(self: *const ForwardCuda, slot: u32) usize",
                  "anchor": "forward-cuda-slot-state-offset-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-slot-state-offset-bytes",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1230,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1230",
                  "doc": {
                    "summary": "Byte offset of slot `slot`'s recurrent state (ssm layer): slot*ssm_state_len*f4.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Byte offset of slot `slot`'s recurrent state (ssm layer): slot*ssm_state_len*f4."
                  }
                },
                {
                  "name": "resetSlot",
                  "qualified_name": "ForwardCuda.resetSlot",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn resetSlot(self: *ForwardCuda, slot: u32) !void",
                  "anchor": "forward-cuda-reset-slot",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-reset-slot",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1243,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1243",
                  "doc": {
                    "summary": "Effort 28 increment 4 (qwen serving): zero a REUSED slot's SSM conv ring + recurrent state so a new request prefilling from pos=0 into this slot starts from clean state.",
                    "description": [
                      "The serving engine reuses slots across requests (nslots < concurrent clients) and qwen's SSM state is ACCUMULATED (not position-indexed), so without this a reused slot inherits the prior request's recurrent state → corruption. The attention slot KV needs NO reset (it is position-indexed and overwritten on prefill; reads never reach beyond the current sequence's positions — same reason gemma's slot KV reuses cleanly). No-op if slot state is unallocated. Call on ADMIT, before per-token prefill."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Effort 28 increment 4 (qwen serving): zero a REUSED slot's SSM conv ring +\nrecurrent state so a new request prefilling from pos=0 into this slot starts\nfrom clean state. The serving engine reuses slots across requests\n(nslots < concurrent clients) and qwen's SSM state is ACCUMULATED (not\nposition-indexed), so without this a reused slot inherits the prior request's\nrecurrent state → corruption. The attention slot KV needs NO reset (it is\nposition-indexed and overwritten on prefill; reads never reach beyond the\ncurrent sequence's positions — same reason gemma's slot KV reuses cleanly).\nNo-op if slot state is unallocated. Call on ADMIT, before per-token prefill."
                  }
                },
                {
                  "name": "slotStateSmoke",
                  "qualified_name": "ForwardCuda.slotStateSmoke",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slotStateSmoke(self: *ForwardCuda) !bool",
                  "anchor": "forward-cuda-slot-state-smoke",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-slot-state-smoke",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1293,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1293",
                  "doc": {
                    "summary": "Sub-step 4a plumbing smoke: prove the slot-offset arithmetic round-trips and that distinct slots map to NON-overlapping device regions for BOTH the attention KV and the SSM conv + recurrent state.",
                    "description": [
                      "Requires allocSlotState with n_slots >= 2 (so slot 0 and slot n_slots-1 differ). Returns true on success."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Sub-step 4a plumbing smoke: prove the slot-offset arithmetic round-trips and\nthat distinct slots map to NON-overlapping device regions for BOTH the\nattention KV and the SSM conv + recurrent state. Requires allocSlotState\nwith n_slots >= 2 (so slot 0 and slot n_slots-1 differ). Returns true on\nsuccess."
                  }
                },
                {
                  "name": "resetState",
                  "qualified_name": "ForwardCuda.resetState",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn resetState(self: *ForwardCuda) !void",
                  "anchor": "forward-cuda-reset-state",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-reset-state",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1329,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1329",
                  "doc": {
                    "summary": "Reset the production single-sequence recurrent state to a fresh-process start: zero every ssm layer's conv ring + recurrent state and clear the per-layer conv offset.",
                    "description": [
                      "The attention KV cache needs no reset — it is position-indexed and each sequence overwrites from pos 0, reading only what it wrote. Used by the batch harness to make the per-sequence SERIAL reference truly single-sequence (without this, the unindexed SSM recurrent state leaks from one reference sequence into the next). Additive — never called on the real decode/prefill path; that path runs one sequence/process."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Reset the production single-sequence recurrent state to a fresh-process\nstart: zero every ssm layer's conv ring + recurrent state and clear the\nper-layer conv offset. The attention KV cache needs no reset — it is\nposition-indexed and each sequence overwrites from pos 0, reading only what\nit wrote. Used by the batch harness to make the per-sequence SERIAL\nreference truly single-sequence (without this, the unindexed SSM recurrent\nstate leaks from one reference sequence into the next). Additive — never\ncalled on the real decode/prefill path; that path runs one sequence/process."
                  }
                },
                {
                  "name": "decodeStep",
                  "qualified_name": "ForwardCuda.decodeStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeStep(self: *ForwardCuda, token: u32, pos: u32, run_layers: bool) !u32",
                  "anchor": "forward-cuda-decode-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-decode-step",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1344,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1344",
                  "doc": {
                    "summary": "Run one greedy decode step for `token` at sequence position `pos`, returning the argmax token id.",
                    "description": [
                      "v0: embed → final rms_norm → LM head → argmax (layers are gated by `run_layers`)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Run one greedy decode step for `token` at sequence position `pos`,\nreturning the argmax token id. v0: embed → final rms_norm → LM head →\nargmax (layers are gated by `run_layers`)."
                  }
                },
                {
                  "name": "prefillStep",
                  "qualified_name": "ForwardCuda.prefillStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillStep(self: *ForwardCuda, token: u32, pos: u32) !void",
                  "anchor": "forward-cuda-prefill-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-prefill-step",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1410,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1410",
                  "doc": {
                    "summary": "Prefill helper: run every layer (build the KV cache) but SKIP the tail rms_norm + LM head + argmax.",
                    "description": [
                      "A prompt-internal token's logits are never used — only the final prompt token's argmax seeds generation — so the (vocab x n_embd) head matvec is pure waste on T-1 of the T prompt tokens. It is a large share for the MoE models, whose active per-token forward is small next to the full-vocab head. The async layer ops are drained here (waitPending) so the ring is freed each token; bit-identical generation."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Prefill helper: run every layer (build the KV cache) but SKIP the tail\nrms_norm + LM head + argmax. A prompt-internal token's logits are never\nused — only the final prompt token's argmax seeds generation — so the\n(vocab x n_embd) head matvec is pure waste on T-1 of the T prompt tokens.\nIt is a large share for the MoE models, whose active per-token forward is\nsmall next to the full-vocab head. The async layer ops are drained here\n(waitPending) so the ring is freed each token; bit-identical generation."
                  }
                },
                {
                  "name": "prefillBatched",
                  "qualified_name": "ForwardCuda.prefillBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatched(self: *ForwardCuda, tokens: []const u32) !u32",
                  "anchor": "forward-cuda-prefill-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-prefill-batched",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1427,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1427",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "prefillBatchedSlot",
                  "qualified_name": "ForwardCuda.prefillBatchedSlot",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatchedSlot(self: *ForwardCuda, tokens: []const u32, slot: u32) !u32",
                  "anchor": "forward-cuda-prefill-batched-slot",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-prefill-batched-slot",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 1557,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L1557",
                  "doc": {
                    "summary": "Batched prefill that writes KV cache + SSM state into the given slot's per-sequence region (instead of the single-seq scratch).",
                    "description": [
                      "Used by the serve engine so server-mode prefill gets the 5× batched-GEMM speedup instead of falling back to per-token decodeBatch (B=1)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Batched prefill that writes KV cache + SSM state into the given slot's\nper-sequence region (instead of the single-seq scratch). Used by the\nserve engine so server-mode prefill gets the 5× batched-GEMM speedup\ninstead of falling back to per-token decodeBatch (B=1)."
                  }
                },
                {
                  "name": "decodeBatch",
                  "qualified_name": "ForwardCuda.decodeBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeBatch(self: *ForwardCuda, tokens: []const u32, positions: []const u32, slots: []const u32, out: []u32) !void",
                  "anchor": "forward-cuda-decode-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-decode-batch",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 2232,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L2232",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "attentionLayerPub",
                  "qualified_name": "ForwardCuda.attentionLayerPub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn attentionLayerPub(self: *ForwardCuda, L: u32, pos: u32) !void",
                  "anchor": "forward-cuda-attention-layer-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-attention-layer-pub",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 3569,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L3569",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "ssmLayerPub",
                  "qualified_name": "ForwardCuda.ssmLayerPub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ssmLayerPub(self: *ForwardCuda, L: u32) !void",
                  "anchor": "forward-cuda-ssm-layer-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-ssm-layer-pub",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 3573,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L3573",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "ffnBlockPub",
                  "qualified_name": "ForwardCuda.ffnBlockPub",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ffnBlockPub(self: *ForwardCuda, L: u32) !void",
                  "anchor": "forward-cuda-ffn-block-pub",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-ffn-block-pub",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 3577,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L3577",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "readHidden",
                  "qualified_name": "ForwardCuda.readHidden",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn readHidden(self: *ForwardCuda, out: []f32) void",
                  "anchor": "forward-cuda-read-hidden",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-read-hidden",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 3628,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L3628",
                  "doc": {
                    "summary": "Download the current hidden state (for sanity checks).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Download the current hidden state (for sanity checks)."
                  }
                },
                {
                  "name": "readLogits",
                  "qualified_name": "ForwardCuda.readLogits",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn readLogits(self: *ForwardCuda, out: []f32) void",
                  "anchor": "forward-cuda-read-logits",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-cuda/#forward-cuda-read-logits",
                  "source_path": "src/compute/forward_cuda.zig",
                  "source_line": 3633,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_cuda.zig#L3633",
                  "doc": {
                    "summary": "Download the top of the logits buffer (for top-k reporting).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Download the top of the logits buffer (for top-k reporting)."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "forward-metal",
          "title": "Forward Metal",
          "section": "Inference Runtime",
          "summary": "Metal inference engine — decode loop for Apple Silicon.",
          "overview": [
            "This is the Metal equivalent of forward.zig (Vulkan). Uses MSL compute shaders dispatched via the Metal shim."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/",
          "source_path": "src/compute/forward_metal.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L20",
          "counts": {
            "code_lines": 36710,
            "exports": 17,
            "methods": 15,
            "symbols": 32
          },
          "symbols": [
            {
              "name": "CommandEncoderMode",
              "qualified_name": "CommandEncoderMode",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const CommandEncoderMode = metal_command.CommandEncoderMode",
              "anchor": "command-encoder-mode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#command-encoder-mode",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L20",
              "doc": {
                "summary": "Command-encoder mode re-export used by runtime init options.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Command-encoder mode re-export used by runtime init options."
              },
              "members": []
            },
            {
              "name": "runtime_context_cap",
              "qualified_name": "runtime_context_cap",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const runtime_context_cap: u32 = 262144",
              "anchor": "runtime-context-cap",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#runtime-context-cap",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 31,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L31",
              "doc": {
                "summary": "Upper bound on the Metal KV-cache allocation: we still honour the model's architectural context length and the unified-memory budget, but we refuse to allocate more tokens than this in one block to keep allocation latency and staging buffers sane.",
                "description": [
                  "Callers that already right-sized `cfg.context_length` from the device budget (see `memory_plan.autoContextTokensForDeviceBudget`) see this as a soft safety net rather than the primary limit."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Upper bound on the Metal KV-cache allocation: we still honour the model's\narchitectural context length and the unified-memory budget, but we refuse\nto allocate more tokens than this in one block to keep allocation latency\nand staging buffers sane. Callers that already right-sized `cfg.context_length`\nfrom the device budget (see `memory_plan.autoContextTokensForDeviceBudget`)\nsee this as a soft safety net rather than the primary limit."
              },
              "members": []
            },
            {
              "name": "DecodeState",
              "qualified_name": "DecodeState",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DecodeState = struct",
              "anchor": "decode-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#decode-state",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 64,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L64",
              "doc": {
                "summary": "Runtime state for the decode loop.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime state for the decode loop."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "DecodeState.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator) DecodeState",
                  "anchor": "decode-state-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#decode-state-init",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 71,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L71",
                  "doc": {
                    "summary": "Initialize decode state for a fresh Metal generation request.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Initialize decode state for a fresh Metal generation request."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "DecodeState.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *DecodeState) void",
                  "anchor": "decode-state-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#decode-state-deinit",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 81,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L81",
                  "doc": {
                    "summary": "Release the generated-token buffer owned by this decode state.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the generated-token buffer owned by this decode state."
                  }
                }
              ]
            },
            {
              "name": "GenerateMetrics",
              "qualified_name": "GenerateMetrics",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GenerateMetrics = struct",
              "anchor": "generate-metrics",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#generate-metrics",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 88,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L88",
              "doc": {
                "summary": "Metrics from generateWithMetrics: prefill/decode token counts, timing, and throughput.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metrics from generateWithMetrics: prefill/decode token counts, timing, and throughput."
              },
              "members": []
            },
            {
              "name": "GenerateResult",
              "qualified_name": "GenerateResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GenerateResult = struct",
              "anchor": "generate-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#generate-result",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 100,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L100",
              "doc": {
                "summary": "Output tokens and performance metrics from a generation run.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output tokens and performance metrics from a generation run."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "GenerateResult.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *GenerateResult, allocator: std.mem.Allocator) void",
                  "anchor": "generate-result-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#generate-result-deinit",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 105,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L105",
                  "doc": {
                    "summary": "Free the generated token slice returned by `generateWithMetrics`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Free the generated token slice returned by `generateWithMetrics`."
                  }
                }
              ]
            },
            {
              "name": "SamplingParams",
              "qualified_name": "SamplingParams",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SamplingParams = struct",
              "anchor": "sampling-params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#sampling-params",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 112,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L112",
              "doc": {
                "summary": "Token sampling parameters: temperature, top-k, top-p, and repetition penalty.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Token sampling parameters: temperature, top-k, top-p, and repetition penalty."
              },
              "members": [
                {
                  "name": "requiresLogitsReadback",
                  "qualified_name": "SamplingParams.requiresLogitsReadback",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn requiresLogitsReadback(self: @This()) bool",
                  "anchor": "sampling-params-requires-logits-readback",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#sampling-params-requires-logits-readback",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 119,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L119",
                  "doc": {
                    "summary": "Return whether sampling settings require CPU-visible logits instead of greedy argmax.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether sampling settings require CPU-visible logits instead of greedy argmax."
                  }
                }
              ]
            },
            {
              "name": "InitOptions",
              "qualified_name": "InitOptions",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const InitOptions = struct",
              "anchor": "init-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#init-options",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 125,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L125",
              "doc": {
                "summary": "Options for `InferenceEngine.init`: profiling, debug validation, KV cache, and dispatch tuning.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Options for `InferenceEngine.init`: profiling, debug validation, KV cache, and dispatch tuning."
              },
              "members": []
            },
            {
              "name": "RuntimeProfile",
              "qualified_name": "RuntimeProfile",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RuntimeProfile = struct",
              "anchor": "runtime-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#runtime-profile",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 1716,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L1716",
              "doc": {
                "summary": "Per-request profiling counters for dispatch, barrier, and timing breakdown.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-request profiling counters for dispatch, barrier, and timing breakdown."
              },
              "members": []
            },
            {
              "name": "attentionLayerCount",
              "qualified_name": "attentionLayerCount",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn attentionLayerCount(cfg: ModelConfig) u32",
              "anchor": "attention-layer-count",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#attention-layer-count",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 2517,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L2517",
              "doc": {
                "summary": "Return the number of full-attention (non-SSM) transformer layers in the model.",
                "description": [],
                "params": [
                  {
                    "name": "cfg",
                    "description": "Model configuration supplying `n_layers` and the full-attention interval."
                  }
                ],
                "returns": "Count of layers that use full multi-head attention; 0 for pure-SSM models.",
                "notes": [],
                "raw": "Return the number of full-attention (non-SSM) transformer layers in the model."
              },
              "members": []
            },
            {
              "name": "defaultKvCacheQ8Enabled",
              "qualified_name": "defaultKvCacheQ8Enabled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn defaultKvCacheQ8Enabled(config: ModelConfig, debug_validation_enabled: bool) bool",
              "anchor": "default-kv-cache-q8-enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#default-kv-cache-q8-enabled",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 2532,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L2532",
              "doc": {
                "summary": "Return whether Q8 KV cache quantization should be enabled by default for this model.",
                "description": [
                  "is available for numerical validation. gpt-oss (SwiGLU sensitivity) and Gemma4 with SWA (ISWA rotation path not yet ported)."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Model configuration used to check architecture and key-value dimensions."
                  },
                  {
                    "name": "debug_validation_enabled",
                    "description": "When true, always returns false so the unquantized cache"
                  }
                ],
                "returns": "True when the architecture and dimensions support Q8 KV cache; false for",
                "notes": [],
                "raw": "Return whether Q8 KV cache quantization should be enabled by default for this model.\nis available for numerical validation.\ngpt-oss (SwiGLU sensitivity) and Gemma4 with SWA (ISWA rotation path not yet ported)."
              },
              "members": []
            },
            {
              "name": "kvCacheBytesPerToken",
              "qualified_name": "kvCacheBytesPerToken",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn kvCacheBytesPerToken(config: ModelConfig, q8_enabled: bool) u64",
              "anchor": "kv-cache-bytes-per-token",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#kv-cache-bytes-per-token",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 2551,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L2551",
              "doc": {
                "summary": "Return the bytes consumed per token in the KV cache.",
                "description": [
                  "otherwise returns the unquantized f32 size."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Model configuration providing `n_kv_heads` and `head_dim`."
                  },
                  {
                    "name": "q8_enabled",
                    "description": "When true, returns the Q8_0 packed size (34 bytes per 32 floats);"
                  }
                ],
                "returns": "Bytes per KV-cache slot for a single token position.",
                "notes": [],
                "raw": "Return the bytes consumed per token in the KV cache.\notherwise returns the unquantized f32 size."
              },
              "members": []
            },
            {
              "name": "InferenceEngine",
              "qualified_name": "InferenceEngine",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const InferenceEngine = struct",
              "anchor": "inference-engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 6811,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L6811",
              "doc": {
                "summary": "Metal inference engine — owns GPU buffers, pipelines, and KV cache.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal inference engine — owns GPU buffers, pipelines, and KV cache."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "InferenceEngine.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( model: *const metal_loader.Model, device: *const metal_device.MetalDevice, allocator: std.mem.Allocator, options: InitOptions, ) !InferenceEngine",
                  "anchor": "inference-engine-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-init",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 7265,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L7265",
                  "doc": {
                    "summary": "Initialize the Metal inference engine, allocating GPU buffers and compiling pipelines.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Initialize the Metal inference engine, allocating GPU buffers and compiling pipelines."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "InferenceEngine.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *InferenceEngine) void",
                  "anchor": "inference-engine-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-deinit",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 8608,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L8608",
                  "doc": {
                    "summary": "Release all GPU buffers, pipelines, and associated resources.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release all GPU buffers, pipelines, and associated resources."
                  }
                },
                {
                  "name": "sampleGreedy",
                  "qualified_name": "InferenceEngine.sampleGreedy",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sampleGreedy(self: *const InferenceEngine) u32",
                  "anchor": "inference-engine-sample-greedy",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-sample-greedy",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 9009,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L9009",
                  "doc": {
                    "summary": "Sample the next token greedily (argmax over logits).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Sample the next token greedily (argmax over logits)."
                  }
                },
                {
                  "name": "sample",
                  "qualified_name": "InferenceEngine.sample",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sample(self: *const InferenceEngine, history: []const u32, params: SamplingParams, random: std.Random) u32",
                  "anchor": "inference-engine-sample",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-sample",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 9053,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L9053",
                  "doc": {
                    "summary": "Sample next token using temperature, top-k, top-p, and repetition penalty.",
                    "description": [
                      "Falls back to greedy if parameters are near-default or buffers are private."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Sample next token using temperature, top-k, top-p, and repetition penalty.\nFalls back to greedy if parameters are near-default or buffers are private."
                  }
                },
                {
                  "name": "enableLogitsReadback",
                  "qualified_name": "InferenceEngine.enableLogitsReadback",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enableLogitsReadback(self: *InferenceEngine) void",
                  "anchor": "inference-engine-enable-logits-readback",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-enable-logits-readback",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 9061,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L9061",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "resetRequestState",
                  "qualified_name": "InferenceEngine.resetRequestState",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn resetRequestState(self: *InferenceEngine, requested_context_tokens: u32) !void",
                  "anchor": "inference-engine-reset-request-state",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-reset-request-state",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 9072,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L9072",
                  "doc": {
                    "summary": "Reset position, profiling counters, and SSM state for a new request.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Reset position, profiling counters, and SSM state for a new request."
                  }
                },
                {
                  "name": "prefillBatch",
                  "qualified_name": "InferenceEngine.prefillBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatch(self: *InferenceEngine, state: *DecodeState, prompt_tokens: []const u32) !void",
                  "anchor": "inference-engine-prefill-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-prefill-batch",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 9315,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L9315",
                  "doc": {
                    "summary": "Run prompt prefill in token-major order, processing one token through all layers at a time.",
                    "description": [
                      "Uses a queued async-submit path for short prompts when available; falls back to sequential `commitAndWait` per token otherwise. Callers that want the layer-major batched path should use `prefillBatched` instead. engine's internal position (stale or mismatched state)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [
                      "Returns `error.ContextLengthExceeded` if the prompt would overflow the KV cache.",
                      "Returns `error.KvStateNotAvailable` if `state.position` does not match the"
                    ],
                    "raw": "Run prompt prefill in token-major order, processing one token through all layers at a time.\nUses a queued async-submit path for short prompts when available; falls back to\nsequential `commitAndWait` per token otherwise. Callers that want the layer-major\nbatched path should use `prefillBatched` instead.\nengine's internal position (stale or mismatched state)."
                  }
                },
                {
                  "name": "prefillBatched",
                  "qualified_name": "InferenceEngine.prefillBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatched(self: *InferenceEngine, state: *DecodeState, prompt_tokens: []const u32) !void",
                  "anchor": "inference-engine-prefill-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-prefill-batched",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 10088,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L10088",
                  "doc": {
                    "summary": "Experimental batched prompt prefill gated by `ZINC_BATCHED_PREFILL`.",
                    "description": [
                      "Processes all prompt tokens in a single batched forward pass using the gemm_q4k / gemm_q6k / rope_batched / flash_attn_batched shaders — the weight matrix for each projection is read once for the whole prompt. Falls back to the per-token `prefillBatch` when the env flag is off or when the model architecture is outside the supported slice (see `canUseBatchedPrefill`). Supports both fresh prefill (state.position==0) and prefix reuse (state.position>0) — in the latter case, the batched pass extends the KV cache at offset `state.position` and flash attention causal masking is computed relative to that offset. With `ZINC_BATCHED_PREFILL=validate` the batched path runs first, then the per-token path is replayed on a fresh state and the last-token logits are diffed; max abs diff is logged and a warning is emitted if it exceeds 1e-3."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Experimental batched prompt prefill gated by `ZINC_BATCHED_PREFILL`.\n\nProcesses all prompt tokens in a single batched forward pass using the\ngemm_q4k / gemm_q6k / rope_batched / flash_attn_batched shaders — the\nweight matrix for each projection is read once for the whole prompt.\nFalls back to the per-token `prefillBatch` when the env flag is off or\nwhen the model architecture is outside the supported slice (see\n`canUseBatchedPrefill`). Supports both fresh prefill (state.position==0)\nand prefix reuse (state.position>0) — in the latter case, the batched\npass extends the KV cache at offset `state.position` and flash attention\ncausal masking is computed relative to that offset. With\n`ZINC_BATCHED_PREFILL=validate` the batched path runs first, then the\nper-token path is replayed on a fresh state and the last-token logits\nare diffed; max abs diff is logged and a warning is emitted if it\nexceeds 1e-3."
                  }
                },
                {
                  "name": "decodeStep",
                  "qualified_name": "InferenceEngine.decodeStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeStep(self: *InferenceEngine, state: *DecodeState, token_id: u32) !void",
                  "anchor": "inference-engine-decode-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-decode-step",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 10442,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L10442",
                  "doc": {
                    "summary": "Advance one autoregressive decode step from the given input token.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Advance one autoregressive decode step from the given input token."
                  }
                },
                {
                  "name": "enableProfiling",
                  "qualified_name": "InferenceEngine.enableProfiling",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enableProfiling(self: *InferenceEngine) !void",
                  "anchor": "inference-engine-enable-profiling",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-enable-profiling",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 10456,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L10456",
                  "doc": {
                    "summary": "Enable request-level profiling counters for subsequent decode work.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Enable request-level profiling counters for subsequent decode work."
                  }
                },
                {
                  "name": "logRequestProfileSummary",
                  "qualified_name": "InferenceEngine.logRequestProfileSummary",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn logRequestProfileSummary(self: *const InferenceEngine, label: []const u8, prompt_tokens: usize, completion_tokens: u32) void",
                  "anchor": "inference-engine-log-request-profile-summary",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#inference-engine-log-request-profile-summary",
                  "source_path": "src/compute/forward_metal.zig",
                  "source_line": 10470,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L10470",
                  "doc": {
                    "summary": "Log the collected Metal profiling summary for the current request to the scoped logger.",
                    "description": [
                      "Does nothing when profiling was not enabled via `enableProfiling`."
                    ],
                    "params": [
                      {
                        "name": "label",
                        "description": "Short identifier string included in every log line (e.g. model name)."
                      },
                      {
                        "name": "prompt_tokens",
                        "description": "Number of prompt tokens processed during prefill."
                      },
                      {
                        "name": "completion_tokens",
                        "description": "Number of tokens generated during decode."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Log the collected Metal profiling summary for the current request to the scoped logger.\nDoes nothing when profiling was not enabled via `enableProfiling`."
                  }
                }
              ]
            },
            {
              "name": "dequantRow",
              "qualified_name": "dequantRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dequantRow(raw_data: []const u8, row: u32, cols: u32, quant_type: GGMLType, output: []f32) void",
              "anchor": "dequant-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#dequant-row",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 20756,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L20756",
              "doc": {
                "summary": "Dequantize one row of quantized weight data to f32 values.",
                "description": [
                  "Supports f32, f16, Q5_0, Q5_1, Q8_0, Q4_K, Q5_K, Q6_K, and MXFP4. Unsupported types log a warning and zero the output slice."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the full matrix."
                  },
                  {
                    "name": "row",
                    "description": "Zero-based row index to dequantize."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns (elements) per row."
                  },
                  {
                    "name": "quant_type",
                    "description": "GGML quantization type describing the on-disk layout."
                  },
                  {
                    "name": "output",
                    "description": "Caller-allocated slice of at least `cols` f32 values; filled in place."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Dequantize one row of quantized weight data to f32 values.\nSupports f32, f16, Q5_0, Q5_1, Q8_0, Q4_K, Q5_K, Q6_K, and MXFP4.\nUnsupported types log a warning and zero the output slice."
              },
              "members": []
            },
            {
              "name": "topKSoftmaxWeight",
              "qualified_name": "topKSoftmaxWeight",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn topKSoftmaxWeight(logits: []const f32, k: u32, out_ids: []u32, out_weights: []f32) void",
              "anchor": "top-ksoftmax-weight",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#top-ksoftmax-weight",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 21039,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L21039",
              "doc": {
                "summary": "Select the top-k entries by raw logit value, then apply softmax over only those k values.",
                "description": [
                  "Used for the SOFTMAX_WEIGHT expert-routing variant (gpt-oss), which differs from `topKSoftmax` in that softmax is applied to the pre-selected raw logits rather than to the full probability distribution first."
                ],
                "params": [
                  {
                    "name": "logits",
                    "description": "Raw router logit values, one per expert."
                  },
                  {
                    "name": "k",
                    "description": "Number of top experts to select."
                  },
                  {
                    "name": "out_ids",
                    "description": "Output slice of length k; filled with the indices of selected experts."
                  },
                  {
                    "name": "out_weights",
                    "description": "Output slice of length k; filled with softmax-normalized weights."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Select the top-k entries by raw logit value, then apply softmax over only those k values.\nUsed for the SOFTMAX_WEIGHT expert-routing variant (gpt-oss), which differs from\n`topKSoftmax` in that softmax is applied to the pre-selected raw logits rather than\nto the full probability distribution first."
              },
              "members": []
            },
            {
              "name": "topKSoftmax",
              "qualified_name": "topKSoftmax",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn topKSoftmax(logits: []const f32, k: u32, out_ids: []u32, out_weights: []f32) void",
              "anchor": "top-ksoftmax",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#top-ksoftmax",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 21074,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L21074",
              "doc": {
                "summary": "Apply softmax over all logits, then select the top-k entries by probability and renormalize.",
                "description": [],
                "params": [
                  {
                    "name": "logits",
                    "description": "Raw router logit values, one per expert."
                  },
                  {
                    "name": "k",
                    "description": "Number of top experts to select."
                  },
                  {
                    "name": "out_ids",
                    "description": "Output slice of length k; filled with the indices of selected experts."
                  },
                  {
                    "name": "out_weights",
                    "description": "Output slice of length k; filled with renormalized softmax weights."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Apply softmax over all logits, then select the top-k entries by probability and renormalize."
              },
              "members": []
            },
            {
              "name": "generateWithMetrics",
              "qualified_name": "generateWithMetrics",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn generateWithMetrics( engine: *InferenceEngine, prompt_tokens: []const u32, max_tokens: u32, eos_id: u32, allocator: std.mem.Allocator, ) !GenerateResult",
              "anchor": "generate-with-metrics",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#generate-with-metrics",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 30149,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L30149",
              "doc": {
                "summary": "Run prompt prefill followed by autoregressive decode and return tokens with timing metrics.",
                "description": [],
                "params": [
                  {
                    "name": "engine",
                    "description": "Initialized inference engine owning the model weights and KV cache."
                  },
                  {
                    "name": "prompt_tokens",
                    "description": "Tokenized prompt; may be empty for continuation from a prior state."
                  },
                  {
                    "name": "max_tokens",
                    "description": "Upper bound on the number of tokens to generate (not counting prompt)."
                  },
                  {
                    "name": "eos_id",
                    "description": "Token id that terminates generation early when sampled."
                  },
                  {
                    "name": "allocator",
                    "description": "Used to allocate the returned `output_tokens` slice; caller must free via `GenerateResult.deinit`."
                  }
                ],
                "returns": "`GenerateResult` with the generated token slice and per-phase timing metrics.",
                "notes": [],
                "raw": "Run prompt prefill followed by autoregressive decode and return tokens with timing metrics."
              },
              "members": []
            },
            {
              "name": "generate",
              "qualified_name": "generate",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn generate( engine: *InferenceEngine, prompt_tokens: []const u32, max_tokens: u32, eos_id: u32, allocator: std.mem.Allocator, ) ![]u32",
              "anchor": "generate",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-metal/#generate",
              "source_path": "src/compute/forward_metal.zig",
              "source_line": 30258,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_metal.zig#L30258",
              "doc": {
                "summary": "Run prefill and decode, log throughput, and return only the generated token slice.",
                "description": [
                  "Convenience wrapper around `generateWithMetrics` for callers that do not need the structured `GenerateMetrics` breakdown."
                ],
                "params": [
                  {
                    "name": "engine",
                    "description": "Initialized inference engine owning the model weights and KV cache."
                  },
                  {
                    "name": "prompt_tokens",
                    "description": "Tokenized prompt passed directly to `generateWithMetrics`."
                  },
                  {
                    "name": "max_tokens",
                    "description": "Upper bound on tokens to generate."
                  },
                  {
                    "name": "eos_id",
                    "description": "Token id that terminates generation early when sampled."
                  },
                  {
                    "name": "allocator",
                    "description": "Used to allocate the returned slice; caller is responsible for freeing it."
                  }
                ],
                "returns": "Caller-owned slice of generated token ids (excludes the prompt).",
                "notes": [],
                "raw": "Run prefill and decode, log throughput, and return only the generated token slice.\nConvenience wrapper around `generateWithMetrics` for callers that do not need the\nstructured `GenerateMetrics` breakdown."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "forward-zinc-rt",
          "title": "Forward Zinc Rt",
          "section": "Inference Runtime",
          "summary": "ZINC_RT forward-pass bring-up.",
          "overview": [
            "M1 wires a scalar forward path for the hybrid Qwen MoE+SSM model used by the RDNA migration harness, plus the first AMDGPU-CS-produced token boundary. The old no-layer tail remains as a smoke fallback for unsupported shapes."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/",
          "source_path": "src/compute/forward_zinc_rt.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L21",
          "counts": {
            "code_lines": 9253,
            "exports": 11,
            "methods": 11,
            "symbols": 22
          },
          "symbols": [
            {
              "name": "m0_max_decode_tokens_default",
              "qualified_name": "m0_max_decode_tokens_default",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const m0_max_decode_tokens_default: u32 = 8",
              "anchor": "m0-max-decode-tokens-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#m0-max-decode-tokens-default",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L21",
              "doc": {
                "summary": "Decode-token budget used by the no-layer smoke tail (`generateNoLayer`) and by benchmarks that want a short, bounded run on the scalar reference path.",
                "description": [
                  "The full M1 forward paths (`generateScalarHybrid`, `generateScalarDense`) pass the caller-supplied `max_tokens` through unchanged and never consult this constant. Override via ZINC_RT_MAX_DECODE_TOKENS."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Decode-token budget used by the no-layer smoke tail (`generateNoLayer`) and\nby benchmarks that want a short, bounded run on the scalar reference path.\nThe full M1 forward paths (`generateScalarHybrid`, `generateScalarDense`)\npass the caller-supplied `max_tokens` through unchanged and never consult\nthis constant. Override via ZINC_RT_MAX_DECODE_TOKENS."
              },
              "members": []
            },
            {
              "name": "Model",
              "qualified_name": "Model",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Model = struct",
              "anchor": "model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#model",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 57,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L57",
              "doc": {
                "summary": "Loaded GGUF model plus all the load-time scratch derived from it.",
                "description": [
                  "Owns the mmap'd file, the resolved per-layer tensor table, the cached F32 dequants of small norm/SSM-side tensors, and the re-quantized weight blobs the decode path streams in place of the larger source-format weights. A `Model` is built once with `load` and consumed by `generate` / `generateWithOptions`; the GPU rings get the same handle so they can read the underlying bytes too."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Loaded GGUF model plus all the load-time scratch derived from it.\nOwns the mmap'd file, the resolved per-layer tensor table, the cached F32\ndequants of small norm/SSM-side tensors, and the re-quantized weight blobs\nthe decode path streams in place of the larger source-format weights. A\n`Model` is built once with `load` and consumed by `generate` /\n`generateWithOptions`; the GPU rings get the same handle so they can read\nthe underlying bytes too."
              },
              "members": [
                {
                  "name": "load",
                  "qualified_name": "Model.load",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn load(path: []const u8, allocator: std.mem.Allocator) !Model",
                  "anchor": "model-load",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#model-load",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 132,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L132",
                  "doc": {
                    "summary": "Memory-map a GGUF model file, parse its metadata, and pre-build the load-time caches the scalar decode path relies on (small F32 norm/SSM tensors, Q8_0→Q4_0 and F32→Q8_0 re-quantizations of the heavier per-token weight streams, RoPE inverse-frequency table, attention sinks, SSM conv1d kernels).",
                    "description": [
                      "The returned handle must eventually be released with `deinit`. unreadable, the tensors don't match the expected shapes, or the GGUF metadata is malformed."
                    ],
                    "params": [
                      {
                        "name": "path",
                        "description": "Filesystem path to the GGUF model."
                      },
                      {
                        "name": "allocator",
                        "description": "Owns every secondary allocation reachable from `Model`."
                      }
                    ],
                    "returns": "A fully-initialised `Model`, or an error if the file is",
                    "notes": [],
                    "raw": "Memory-map a GGUF model file, parse its metadata, and pre-build the\nload-time caches the scalar decode path relies on (small F32 norm/SSM\ntensors, Q8_0→Q4_0 and F32→Q8_0 re-quantizations of the heavier\nper-token weight streams, RoPE inverse-frequency table, attention sinks,\nSSM conv1d kernels). The returned handle must eventually be released\nwith `deinit`.\nunreadable, the tensors don't match the expected shapes, or the GGUF\nmetadata is malformed."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Model.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Model) void",
                  "anchor": "model-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#model-deinit",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 421,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L421",
                  "doc": {
                    "summary": "Release every allocation reachable from `Model`: the re-quantized weight blobs, the small-tensor F32 cache, the SSM/RoPE/attention-sink scratch, the GGUF parse state, the mmap, and the file handle.",
                    "description": [
                      "Poisons `self`; the handle must not be reused afterwards."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release every allocation reachable from `Model`: the re-quantized\nweight blobs, the small-tensor F32 cache, the SSM/RoPE/attention-sink\nscratch, the GGUF parse state, the mmap, and the file handle. Poisons\n`self`; the handle must not be reused afterwards."
                  }
                },
                {
                  "name": "validateDecodeGraph",
                  "qualified_name": "Model.validateDecodeGraph",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn validateDecodeGraph(self: *const Model, allocator: std.mem.Allocator) !DecodeGraphSummary",
                  "anchor": "model-validate-decode-graph",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#model-validate-decode-graph",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 498,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L498",
                  "doc": {
                    "summary": "Emit the per-token decode IR for this model's shape and run the validator on it, returning a node/layer count summary the caller can log or assert against.",
                    "description": [
                      "Used as an admission gate before a real decode run so a malformed graph fails loud and early instead of corrupting the scalar kernels mid-token. return."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Used for the throwaway IR graph; released before"
                      }
                    ],
                    "returns": "Summary of the emitted-and-validated decode graph.",
                    "notes": [],
                    "raw": "Emit the per-token decode IR for this model's shape and run the\nvalidator on it, returning a node/layer count summary the caller can\nlog or assert against. Used as an admission gate before a real decode\nrun so a malformed graph fails loud and early instead of corrupting the\nscalar kernels mid-token.\nreturn."
                  }
                }
              ]
            },
            {
              "name": "DecodeGraphSummary",
              "qualified_name": "DecodeGraphSummary",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DecodeGraphSummary = struct",
              "anchor": "decode-graph-summary",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#decode-graph-summary",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1101,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1101",
              "doc": {
                "summary": "Counts produced by `Model.validateDecodeGraph` — how many IR nodes were emitted, and how the per-layer mix (full attention, SSM, MoE) breaks down.",
                "description": [
                  "Useful for asserting the lowered graph matches the model's expected shape."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Counts produced by `Model.validateDecodeGraph` — how many IR nodes were\nemitted, and how the per-layer mix (full attention, SSM, MoE) breaks down.\nUseful for asserting the lowered graph matches the model's expected shape."
              },
              "members": []
            },
            {
              "name": "DirectComputeKind",
              "qualified_name": "DirectComputeKind",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const DirectComputeKind = enum",
              "anchor": "direct-compute-kind",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#direct-compute-kind",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1114,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1114",
              "doc": {
                "summary": "Tag identifying which direct-compute shortcut the active tier executed for the current decode step.",
                "description": [
                  "`none` means the scalar host path retired the token; the other variants name the kernel the GPU ring actually ran (a first-element RMSNorm, an argmax, an argmax composed with that RMSNorm, or a row-range dequantized matvec)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tag identifying which direct-compute shortcut the active tier executed for\nthe current decode step. `none` means the scalar host path retired the\ntoken; the other variants name the kernel the GPU ring actually ran (a\nfirst-element RMSNorm, an argmax, an argmax composed with that RMSNorm, or\na row-range dequantized matvec)."
              },
              "members": []
            },
            {
              "name": "BenchmarkShortcutFlags",
              "qualified_name": "BenchmarkShortcutFlags",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BenchmarkShortcutFlags = struct",
              "anchor": "benchmark-shortcut-flags",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#benchmark-shortcut-flags",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1139,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1139",
              "doc": {
                "summary": "Flags marking which benchmark-only fast-paths influenced the run.",
                "description": [
                  "The performance suite consults these to decide whether a number is comparable to the reference scalar path or whether a measurement-only shortcut was in effect (top-k forced to zero, LM-head row count capped, decode budget clamped)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Flags marking which benchmark-only fast-paths influenced the run. The\nperformance suite consults these to decide whether a number is comparable\nto the reference scalar path or whether a measurement-only shortcut was in\neffect (top-k forced to zero, LM-head row count capped, decode budget\nclamped)."
              },
              "members": [
                {
                  "name": "any",
                  "qualified_name": "BenchmarkShortcutFlags.any",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn any(self: BenchmarkShortcutFlags) bool",
                  "anchor": "benchmark-shortcut-flags-any",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#benchmark-shortcut-flags-any",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 1145,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1145",
                  "doc": {
                    "summary": "True if any benchmark shortcut was applied during the run.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "True if any benchmark shortcut was applied during the run."
                  }
                }
              ]
            },
            {
              "name": "GenerateResult",
              "qualified_name": "GenerateResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GenerateResult = struct",
              "anchor": "generate-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#generate-result",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1156,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1156",
              "doc": {
                "summary": "Output of a `generate` / `generateWithOptions` call: the produced token stream, prefill / decode wall-clock splits, the originally-requested and effective decode budgets, and a set of direct-tier instrumentation counters that report how much of the per-token work was actually retired by the GPU ring versus by the scalar fallback.",
                "description": [
                  "The token slice is allocator-owned and must be released with `deinit`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output of a `generate` / `generateWithOptions` call: the produced token\nstream, prefill / decode wall-clock splits, the originally-requested and\neffective decode budgets, and a set of direct-tier instrumentation\ncounters that report how much of the per-token work was actually retired\nby the GPU ring versus by the scalar fallback.\nThe token slice is allocator-owned and must be released with `deinit`."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "GenerateResult.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *GenerateResult, allocator: std.mem.Allocator) void",
                  "anchor": "generate-result-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#generate-result-deinit",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 1178,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1178",
                  "doc": {
                    "summary": "Free the produced token slice and poison the handle.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Same allocator that was passed to `generate`."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Free the produced token slice and poison the handle."
                  }
                }
              ]
            },
            {
              "name": "GenerateOptions",
              "qualified_name": "GenerateOptions",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GenerateOptions = struct",
              "anchor": "generate-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#generate-options",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1187,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1187",
              "doc": {
                "summary": "Knobs threaded through to `generateWithOptions`.",
                "description": [
                  "Lets callers opt out of the per-token direct-tier admission validation when they only want the scalar reference numbers."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Knobs threaded through to `generateWithOptions`. Lets callers opt out of\nthe per-token direct-tier admission validation when they only want the\nscalar reference numbers."
              },
              "members": []
            },
            {
              "name": "generate",
              "qualified_name": "generate",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn generate( model: *const Model, prompt_tokens: []const u32, max_tokens: u32, eos_token_id: u32, allocator: std.mem.Allocator, ) !GenerateResult",
              "anchor": "generate",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#generate",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1206,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1206",
              "doc": {
                "summary": "Run the full ZINC_RT forward pass against `model` with default `GenerateOptions`: prefill the prompt, validate the per-token decode IR, and decode at most `max_tokens` tokens (stopping early on `eos_token_id`).",
                "description": [
                  "Tries the scalar hybrid path, then the scalar dense path, then falls back to a no-layer smoke tail. Equivalent to `generateWithOptions(..., .{})`."
                ],
                "params": [
                  {
                    "name": "model",
                    "description": "Loaded GGUF model."
                  },
                  {
                    "name": "prompt_tokens",
                    "description": "Tokenised prompt; must be non-empty."
                  },
                  {
                    "name": "max_tokens",
                    "description": "Upper bound on tokens to produce after prefill."
                  },
                  {
                    "name": "eos_token_id",
                    "description": "Stop-token id."
                  },
                  {
                    "name": "allocator",
                    "description": "Owns the returned `GenerateResult.tokens`."
                  }
                ],
                "returns": "A `GenerateResult` the caller must release via its `deinit`.",
                "notes": [],
                "raw": "Run the full ZINC_RT forward pass against `model` with default\n`GenerateOptions`: prefill the prompt, validate the per-token decode IR,\nand decode at most `max_tokens` tokens (stopping early on `eos_token_id`).\nTries the scalar hybrid path, then the scalar dense path, then falls back\nto a no-layer smoke tail. Equivalent to `generateWithOptions(..., .{})`."
              },
              "members": []
            },
            {
              "name": "generateWithOptions",
              "qualified_name": "generateWithOptions",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn generateWithOptions( model: *const Model, prompt_tokens: []const u32, max_tokens: u32, eos_token_id: u32, allocator: std.mem.Allocator, options: GenerateOptions, ) !GenerateResult",
              "anchor": "generate-with-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#generate-with-options",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 1231,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L1231",
              "doc": {
                "summary": "Full ZINC_RT forward pass with caller-supplied `GenerateOptions`.",
                "description": [
                  "Logs the validated decode-graph summary, then picks among three paths: the scalar hybrid MoE+SSM path (for Qwen 3.6-shaped models whose tensors fully resolve via `canRunScalarHybrid`), the scalar dense attention path (for Gemma 4-shaped models via `canRunScalarDense`), and the no-layer smoke tail (everything else). The hybrid and dense paths consume the GPU ring's direct-compute results; the smoke tail is CPU-only. throwaway decode IR."
                ],
                "params": [
                  {
                    "name": "model",
                    "description": "Loaded GGUF model."
                  },
                  {
                    "name": "prompt_tokens",
                    "description": "Tokenised prompt; must be non-empty."
                  },
                  {
                    "name": "max_tokens",
                    "description": "Upper bound on tokens to produce after prefill."
                  },
                  {
                    "name": "eos_token_id",
                    "description": "Stop-token id."
                  },
                  {
                    "name": "allocator",
                    "description": "Owns the returned `GenerateResult.tokens` and the"
                  },
                  {
                    "name": "options",
                    "description": "Per-call configuration; see `GenerateOptions`."
                  }
                ],
                "returns": "A `GenerateResult` the caller must release via its `deinit`.",
                "notes": [],
                "raw": "Full ZINC_RT forward pass with caller-supplied `GenerateOptions`. Logs the\nvalidated decode-graph summary, then picks among three paths: the scalar\nhybrid MoE+SSM path (for Qwen 3.6-shaped models whose tensors fully\nresolve via `canRunScalarHybrid`), the scalar dense attention path (for\nGemma 4-shaped models via `canRunScalarDense`), and the no-layer smoke\ntail (everything else). The hybrid and dense paths consume the GPU ring's\ndirect-compute results; the smoke tail is CPU-only.\nthrowaway decode IR."
              },
              "members": []
            },
            {
              "name": "initTokenizer",
              "qualified_name": "initTokenizer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn initTokenizer(model: *const Model, allocator: std.mem.Allocator) !Tokenizer",
              "anchor": "init-tokenizer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#init-tokenizer",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 9238,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9238",
              "doc": {
                "summary": "Build a `Tokenizer` from `model`'s GGUF vocab metadata.",
                "description": [
                  "Convenience wrapper around `Tokenizer.init` so callers don't have to reach into the `Model`'s parse state."
                ],
                "params": [
                  {
                    "name": "model",
                    "description": "Loaded GGUF model whose vocab table is consulted."
                  },
                  {
                    "name": "allocator",
                    "description": "Owns the resulting tokenizer's vocab and id table."
                  }
                ],
                "returns": "A ready-to-use `Tokenizer`.",
                "notes": [],
                "raw": "Build a `Tokenizer` from `model`'s GGUF vocab metadata. Convenience\nwrapper around `Tokenizer.init` so callers don't have to reach into the\n`Model`'s parse state."
              },
              "members": []
            },
            {
              "name": "Tokenizer",
              "qualified_name": "Tokenizer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Tokenizer = struct",
              "anchor": "tokenizer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer",
              "source_path": "src/compute/forward_zinc_rt.zig",
              "source_line": 9246,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9246",
              "doc": {
                "summary": "Minimal longest-match BPE-ish tokenizer that reads the vocab and EOS id straight out of a GGUF file.",
                "description": [
                  "Encodes prompts via the GPT-2 byte-to-unicode mapping and falls back to byte 0 on misses so the scalar M1 forward path always sees a well-formed token stream."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Minimal longest-match BPE-ish tokenizer that reads the vocab and EOS id\nstraight out of a GGUF file. Encodes prompts via the GPT-2 byte-to-unicode\nmapping and falls back to byte 0 on misses so the scalar M1 forward path\nalways sees a well-formed token stream."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Tokenizer.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(gf: *const gguf.GGUFFile, allocator: std.mem.Allocator) !Tokenizer",
                  "anchor": "tokenizer-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-init",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9264,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9264",
                  "doc": {
                    "summary": "Build a tokenizer by reading `tokenizer.ggml.tokens` and `tokenizer.ggml.eos_token_id` out of `gf`.",
                    "description": [
                      "Defaults the EOS id to `2` when the metadata key is missing."
                    ],
                    "params": [
                      {
                        "name": "gf",
                        "description": "GGUF file whose tokenizer metadata is consulted."
                      },
                      {
                        "name": "allocator",
                        "description": "Owns the vocab slice and the id hash table."
                      }
                    ],
                    "returns": "A `Tokenizer` ready for `encodePrompt` / `decodeToken`.",
                    "notes": [],
                    "raw": "Build a tokenizer by reading `tokenizer.ggml.tokens` and\n`tokenizer.ggml.eos_token_id` out of `gf`. Defaults the EOS id to `2`\nwhen the metadata key is missing."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Tokenizer.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Tokenizer) void",
                  "anchor": "tokenizer-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-deinit",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9307,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9307",
                  "doc": {
                    "summary": "Release the vocab slice and the id hash table, then poison the handle.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the vocab slice and the id hash table, then poison the handle."
                  }
                },
                {
                  "name": "eosId",
                  "qualified_name": "Tokenizer.eosId",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn eosId(self: *const Tokenizer) u32",
                  "anchor": "tokenizer-eos-id",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-eos-id",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9314,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9314",
                  "doc": {
                    "summary": "Return the stop token id the caller should pass to `generate`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the stop token id the caller should pass to `generate`."
                  }
                },
                {
                  "name": "encodeGemmaChat",
                  "qualified_name": "Tokenizer.encodeGemmaChat",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn encodeGemmaChat(self: *const Tokenizer, user_text: []const u8, allocator: std.mem.Allocator) !?[]u32",
                  "anchor": "tokenizer-encode-gemma-chat",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-encode-gemma-chat",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9323,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9323",
                  "doc": {
                    "summary": "Wrap the user prompt with Gemma's chat-turn special tokens so the instruction-tuned model has the expected scaffolding.",
                    "description": [
                      "Tries the Gemma 4 tokens (`<|turn>` / `<turn|>`) first, then falls back to Gemma 2/3 tokens (`<start_of_turn>` / `<end_of_turn>`). Returns null when neither set is present in the vocab (i.e. the model isn't Gemma-templated)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Wrap the user prompt with Gemma's chat-turn special tokens so the\ninstruction-tuned model has the expected scaffolding. Tries the Gemma 4\ntokens (`<|turn>` / `<turn|>`) first, then falls back to Gemma 2/3\ntokens (`<start_of_turn>` / `<end_of_turn>`). Returns null when neither\nset is present in the vocab (i.e. the model isn't Gemma-templated)."
                  }
                },
                {
                  "name": "encodePrompt",
                  "qualified_name": "Tokenizer.encodePrompt",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn encodePrompt(self: *const Tokenizer, text: []const u8, allocator: std.mem.Allocator) ![]u32",
                  "anchor": "tokenizer-encode-prompt",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-encode-prompt",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9419,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9419",
                  "doc": {
                    "summary": "Encode `text` into a token id stream using a longest-match scan over the vocab.",
                    "description": [
                      "GPT-2-flavour tokenizers (Qwen) use the byte-to-unicode mapping; SentencePiece-flavour tokenizers (Gemma) substitute spaces with ▁ and pass raw UTF-8 through. Prepends BOS when `add_bos` is set. Unmatched single bytes fall back to token id 0 so the output is always well-formed."
                    ],
                    "params": [
                      {
                        "name": "text",
                        "description": "Raw UTF-8 prompt bytes."
                      },
                      {
                        "name": "allocator",
                        "description": "Owns the returned token slice."
                      }
                    ],
                    "returns": "Token ids ready to feed into `generate`.",
                    "notes": [],
                    "raw": "Encode `text` into a token id stream using a longest-match scan over\nthe vocab. GPT-2-flavour tokenizers (Qwen) use the byte-to-unicode\nmapping; SentencePiece-flavour tokenizers (Gemma) substitute spaces with\n▁ and pass raw UTF-8 through. Prepends BOS when `add_bos` is set.\nUnmatched single bytes fall back to token id 0 so the output is always\nwell-formed."
                  }
                },
                {
                  "name": "decodeToken",
                  "qualified_name": "Tokenizer.decodeToken",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeToken(self: *const Tokenizer, token_id: u32, buf: []u8) []const u8",
                  "anchor": "tokenizer-decode-token",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward-zinc-rt/#tokenizer-decode-token",
                  "source_path": "src/compute/forward_zinc_rt.zig",
                  "source_line": 9462,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward_zinc_rt.zig#L9462",
                  "doc": {
                    "summary": "Render one token id back to its UTF-8 byte form into `buf`.",
                    "description": [
                      "For GPT-2-flavour vocabs the GPT-2 byte-to-unicode mapping is reversed; for SentencePiece-flavour vocabs the SPIECE underline (▁, U+2581) is mapped to a plain space and remaining codepoints are copied as-is. Truncates instead of erroring when `buf` is too small; returns an empty slice for out-of-range ids."
                    ],
                    "params": [
                      {
                        "name": "token_id",
                        "description": "Token id produced by `generate` or `encodePrompt`."
                      },
                      {
                        "name": "buf",
                        "description": "Scratch buffer the decoded bytes are written into."
                      }
                    ],
                    "returns": "The prefix of `buf` containing the decoded bytes.",
                    "notes": [],
                    "raw": "Render one token id back to its UTF-8 byte form into `buf`. For\nGPT-2-flavour vocabs the GPT-2 byte-to-unicode mapping is reversed; for\nSentencePiece-flavour vocabs the SPIECE underline (▁, U+2581) is mapped\nto a plain space and remaining codepoints are copied as-is. Truncates\ninstead of erroring when `buf` is too small; returns an empty slice for\nout-of-range ids."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "forward",
          "title": "Forward",
          "section": "Inference Runtime",
          "summary": "Run the inference runtime: decode state, pipeline ownership, and token generation.",
          "overview": [
            "This module ties together model state, compute graphs, dispatch helpers, and greedy token sampling for a single active inference engine."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/",
          "source_path": "src/compute/forward.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L154",
          "counts": {
            "code_lines": 26736,
            "exports": 4,
            "methods": 14,
            "symbols": 18
          },
          "symbols": [
            {
              "name": "DecodeState",
              "qualified_name": "DecodeState",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DecodeState = struct",
              "anchor": "decode-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#decode-state",
              "source_path": "src/compute/forward.zig",
              "source_line": 154,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L154",
              "doc": {
                "summary": "Runtime state for the decode loop.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime state for the decode loop."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "DecodeState.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator) DecodeState",
                  "anchor": "decode-state-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#decode-state-init",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 167,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L167",
                  "doc": {
                    "summary": "Initialize decode state for a fresh generation request.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator used for the generated token list."
                      }
                    ],
                    "returns": "A DecodeState positioned at token index zero with an empty output buffer.",
                    "notes": [],
                    "raw": "Initialize decode state for a fresh generation request."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "DecodeState.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *DecodeState) void",
                  "anchor": "decode-state-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#decode-state-deinit",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 179,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L179",
                  "doc": {
                    "summary": "Release the generated token buffer owned by the decode state.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Decode state to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "After this call the state is invalid and should not be reused."
                    ],
                    "raw": "Release the generated token buffer owned by the decode state."
                  }
                }
              ]
            },
            {
              "name": "SamplingParams",
              "qualified_name": "SamplingParams",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SamplingParams = struct",
              "anchor": "sampling-params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#sampling-params",
              "source_path": "src/compute/forward.zig",
              "source_line": 186,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L186",
              "doc": {
                "summary": "Token sampling controls shared by the decode loop and HTTP server.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Token sampling controls shared by the decode loop and HTTP server."
              },
              "members": [
                {
                  "name": "requiresLogitsReadback",
                  "qualified_name": "SamplingParams.requiresLogitsReadback",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn requiresLogitsReadback(self: @This()) bool",
                  "anchor": "sampling-params-requires-logits-readback",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#sampling-params-requires-logits-readback",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 195,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L195",
                  "doc": {
                    "summary": "Return whether the current sampling settings require CPU-visible logits.",
                    "description": [
                      "(i.e. any path that needs more than just the argmax token index)."
                    ],
                    "params": [],
                    "returns": "`true` when temperature, top-p, or repetition-penalty are active",
                    "notes": [],
                    "raw": "Return whether the current sampling settings require CPU-visible logits.\n(i.e. any path that needs more than just the argmax token index)."
                  }
                }
              ]
            },
            {
              "name": "InferenceEngine",
              "qualified_name": "InferenceEngine",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const InferenceEngine = struct",
              "anchor": "inference-engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine",
              "source_path": "src/compute/forward.zig",
              "source_line": 1080,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L1080",
              "doc": {
                "summary": "Central inference engine that owns the GPU resources for one active model.",
                "description": [
                  "Holds the loaded model, all Vulkan pipelines and intermediate activation buffers, KV-cache page pool, SSM recurrent state, and per-request profiling counters. One engine instance maps to one GPU device; it is not thread-safe."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Central inference engine that owns the GPU resources for one active model.\nHolds the loaded model, all Vulkan pipelines and intermediate activation buffers,\nKV-cache page pool, SSM recurrent state, and per-request profiling counters.\nOne engine instance maps to one GPU device; it is not thread-safe."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "InferenceEngine.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( model: *Model, instance: *const Instance, gpu_config: GpuConfig, shader_dir: []const u8, allocator: std.mem.Allocator, ) !InferenceEngine",
                  "anchor": "inference-engine-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-init",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 1734,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L1734",
                  "doc": {
                    "summary": "Create the runtime objects needed to execute decode-time work on the GPU.",
                    "description": [],
                    "params": [
                      {
                        "name": "model",
                        "description": "Loaded model weights and metadata."
                      },
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "gpu_config",
                        "description": "Derived GPU tuning parameters for the selected device."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Directory containing compiled SPIR-V shader binaries."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for graphs, staging state, and temporary setup structures."
                      }
                    ],
                    "returns": "An initialized inference engine ready to prefill prompts and run decode steps.",
                    "notes": [
                      "This allocates shared descriptor pools, staging buffers, intermediate activations, and dispatch wrappers up front."
                    ],
                    "raw": "Create the runtime objects needed to execute decode-time work on the GPU."
                  }
                },
                {
                  "name": "enableProfiling",
                  "qualified_name": "InferenceEngine.enableProfiling",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enableProfiling(self: *InferenceEngine) !void",
                  "anchor": "inference-engine-enable-profiling",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-enable-profiling",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 3887,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L3887",
                  "doc": {
                    "summary": "Enable full GPU + CPU profiling.",
                    "description": [
                      "The timestamp query pool is created in `init`, so this just flips the runtime flag. Returns an error if pool creation failed."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Enable full GPU + CPU profiling. The timestamp query pool is created in `init`,\nso this just flips the runtime flag. Returns an error if pool creation failed."
                  }
                },
                {
                  "name": "enableValidationDiagnostics",
                  "qualified_name": "InferenceEngine.enableValidationDiagnostics",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enableValidationDiagnostics(self: *InferenceEngine) void",
                  "anchor": "inference-engine-enable-validation-diagnostics",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-enable-validation-diagnostics",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 3894,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L3894",
                  "doc": {
                    "summary": "Enable the expensive CPU-vs-GPU validation readbacks used for debugging kernel correctness.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Enable the expensive CPU-vs-GPU validation readbacks used for debugging kernel correctness."
                  }
                },
                {
                  "name": "enableLogitsReadback",
                  "qualified_name": "InferenceEngine.enableLogitsReadback",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enableLogitsReadback(self: *InferenceEngine) void",
                  "anchor": "inference-engine-enable-logits-readback",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-enable-logits-readback",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 3899,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L3899",
                  "doc": {
                    "summary": "Preserve full logits on the host for debug dumps and diagnostic inspection.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Preserve full logits on the host for debug dumps and diagnostic inspection."
                  }
                },
                {
                  "name": "recordProfilingSample",
                  "qualified_name": "InferenceEngine.recordProfilingSample",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordProfilingSample(self: *InferenceEngine) void",
                  "anchor": "inference-engine-record-profiling-sample",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-record-profiling-sample",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 4377,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L4377",
                  "doc": {
                    "summary": "Read back all timestamps for the current token and fold them into request-wide profiling stats.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Read back all timestamps for the current token and fold them into request-wide profiling stats."
                  }
                },
                {
                  "name": "decodeStep",
                  "qualified_name": "InferenceEngine.decodeStep",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeStep(self: *InferenceEngine, state: *DecodeState, token_id: u32, collect_output: bool) !void",
                  "anchor": "inference-engine-decode-step",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-decode-step",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 6998,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L6998",
                  "doc": {
                    "summary": "Run a single decode step for one token through all transformer layers.",
                    "description": [
                      "embed → [per-layer: norm → QKV → RoPE → KV write → attention → O proj → residual → FFN norm → MoE routing → expert DMMVs → residual] → final norm → LM head → logits diagnostic or GPT-OSS embedding-collection paths."
                    ],
                    "params": [
                      {
                        "name": "state",
                        "description": "Decode state carrying the current token position and generated token history."
                      },
                      {
                        "name": "token_id",
                        "description": "Vocabulary index of the token to embed and feed forward."
                      },
                      {
                        "name": "collect_output",
                        "description": "When `true`, the engine accumulates layer outputs needed by"
                      }
                    ],
                    "returns": "`error.ContextLengthExceeded` when `state.position` is at capacity.",
                    "notes": [],
                    "raw": "Run a single decode step for one token through all transformer layers.\nembed → [per-layer: norm → QKV → RoPE → KV write → attention → O proj → residual\n→ FFN norm → MoE routing → expert DMMVs → residual] → final norm → LM head → logits\ndiagnostic or GPT-OSS embedding-collection paths."
                  }
                },
                {
                  "name": "prefillBatched",
                  "qualified_name": "InferenceEngine.prefillBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatched(self: *InferenceEngine, state: *DecodeState, prompt_tokens: []const u32) !void",
                  "anchor": "inference-engine-prefill-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-prefill-batched",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 26991,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L26991",
                  "doc": {
                    "summary": "Experimental batched prompt prefill for the RDNA/Vulkan backend. Gated by `ZINC_BATCHED_PREFILL=1`. This is the Vulkan analogue of `forward_metal.InferenceEngine.prefillBatched`.",
                    "description": [
                      "Routes to `prefillA3bProduction` or `prefillQwen36DenseFfnPrefix` when the model and prompt length match those specialized paths; otherwise falls back to the `canUseBatchedPrefillRdna`-gated batched body or `prefillBatch` (per-token serial path). Set `ZINC_BATCHED_PREFILL=0` to force the serial fallback or `=validate` to run both paths and diff the last-token logits. Intel Arc Gemma uses the chunked batched path by default; Qwen 3.6 A3B uses the specialized layer-major path by default; other Intel models still require `ZINC_INTEL_BATCHED_PREFILL=1` to opt in."
                    ],
                    "params": [
                      {
                        "name": "state",
                        "description": "Decode state for the current request."
                      },
                      {
                        "name": "prompt_tokens",
                        "description": "Tokenized prompt sequence to prefill."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Experimental batched prompt prefill for the RDNA/Vulkan backend.\nGated by `ZINC_BATCHED_PREFILL=1`. This is the Vulkan analogue of\n`forward_metal.InferenceEngine.prefillBatched`.\n\nRoutes to `prefillA3bProduction` or `prefillQwen36DenseFfnPrefix` when the\nmodel and prompt length match those specialized paths; otherwise falls back to\nthe `canUseBatchedPrefillRdna`-gated batched body or `prefillBatch` (per-token\nserial path). Set `ZINC_BATCHED_PREFILL=0` to force the serial fallback or\n`=validate` to run both paths and diff the last-token logits. Intel Arc\nGemma uses the chunked batched path by default; Qwen 3.6 A3B uses the\nspecialized layer-major path by default; other Intel models still\nrequire `ZINC_INTEL_BATCHED_PREFILL=1` to opt in."
                  }
                },
                {
                  "name": "prefillBatch",
                  "qualified_name": "InferenceEngine.prefillBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn prefillBatch(self: *InferenceEngine, state: *DecodeState, prompt_tokens: []const u32) !void",
                  "anchor": "inference-engine-prefill-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-prefill-batch",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 27747,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L27747",
                  "doc": {
                    "summary": "Process all prompt tokens sequentially (one token per GPU submission) to populate KV cache and SSM state before the first decode step.",
                    "description": [
                      "an active KV-page allocation for continuation prefill."
                    ],
                    "params": [
                      {
                        "name": "state",
                        "description": "Decode state; must start at position 0 for a fresh request or have"
                      },
                      {
                        "name": "prompt_tokens",
                        "description": "Tokenized input sequence to prefill. No-op when empty."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "This is the per-token serial path. For the experimental batched variant see `prefillBatched`."
                    ],
                    "raw": "Process all prompt tokens sequentially (one token per GPU submission) to populate\nKV cache and SSM state before the first decode step.\nan active KV-page allocation for continuation prefill."
                  }
                },
                {
                  "name": "sampleGreedy",
                  "qualified_name": "InferenceEngine.sampleGreedy",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sampleGreedy(self: *const InferenceEngine) u32",
                  "anchor": "inference-engine-sample-greedy",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-sample-greedy",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 28573,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L28573",
                  "doc": {
                    "summary": "Sample a token greedily.",
                    "description": [
                      "Uses GPU argmax when available, otherwise falls back to CPU scan."
                    ],
                    "params": [],
                    "returns": "The vocabulary index of the highest-logit token.",
                    "notes": [],
                    "raw": "Sample a token greedily. Uses GPU argmax when available, otherwise falls back to CPU scan."
                  }
                },
                {
                  "name": "sample",
                  "qualified_name": "InferenceEngine.sample",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sample(self: *const InferenceEngine, state: *const DecodeState, params: SamplingParams, random: std.Random) u32",
                  "anchor": "inference-engine-sample",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-sample",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 28601,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L28601",
                  "doc": {
                    "summary": "Sample the next token using greedy argmax or stochastic sampling depending on `params`.",
                    "description": [
                      "Delegates to `sampleGreedy` when no logit readback is needed; otherwise reads staged logits from the host and applies temperature, top-p, top-k, and repetition penalty."
                    ],
                    "params": [
                      {
                        "name": "state",
                        "description": "Decode state supplying the generated-token history for repetition penalty."
                      },
                      {
                        "name": "params",
                        "description": "Sampling hyper-parameters controlling temperature and nucleus filtering."
                      },
                      {
                        "name": "random",
                        "description": "Random source for stochastic sampling; unused on the greedy path."
                      }
                    ],
                    "returns": "The sampled vocabulary token index.",
                    "notes": [],
                    "raw": "Sample the next token using greedy argmax or stochastic sampling depending on `params`.\nDelegates to `sampleGreedy` when no logit readback is needed; otherwise reads staged\nlogits from the host and applies temperature, top-p, top-k, and repetition penalty."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "InferenceEngine.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *InferenceEngine) void",
                  "anchor": "inference-engine-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#inference-engine-deinit",
                  "source_path": "src/compute/forward.zig",
                  "source_line": 29090,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L29090",
                  "doc": {
                    "summary": "Release GPU buffers, graphs, command objects, and dispatch helpers owned by the engine.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release GPU buffers, graphs, command objects, and dispatch helpers owned by the engine."
                  }
                }
              ]
            },
            {
              "name": "generate",
              "qualified_name": "generate",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn generate( engine: *InferenceEngine, prompt_tokens: []const u32, max_tokens: u32, eos_token_id: u32, allocator: std.mem.Allocator, ) ![]u32",
              "anchor": "generate",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/forward/#generate",
              "source_path": "src/compute/forward.zig",
              "source_line": 29264,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/forward.zig#L29264",
              "doc": {
                "summary": "Run single-request inference: prefill the prompt, decode greedily, and return generated token IDs.",
                "description": [],
                "params": [
                  {
                    "name": "engine",
                    "description": "Initialized inference engine."
                  },
                  {
                    "name": "prompt_tokens",
                    "description": "Tokenized prompt that seeds the prefill pass."
                  },
                  {
                    "name": "max_tokens",
                    "description": "Maximum number of decode tokens to emit after prefill."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for transient decode state and the returned token slice."
                  }
                ],
                "returns": "A heap-allocated slice containing only the generated continuation tokens.",
                "notes": [
                  "Generation stops early when the sampled token equals `eos_token_id`."
                ],
                "raw": "Run single-request inference: prefill the prompt, decode greedily, and return generated token IDs."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "interface",
          "title": "Interface",
          "section": "Inference Runtime",
          "summary": "GPU backend abstraction — comptime-resolved, zero runtime overhead.",
          "overview": [
            "macOS → Metal. Linux → Vulkan by default, or CUDA with `-Dbackend=cuda` (NVIDIA / WSL2, where Vulkan is CPU-only). See docs/cuda-backend.md."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/",
          "source_path": "src/gpu/interface.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L10",
          "counts": {
            "code_lines": 47,
            "exports": 5,
            "methods": 0,
            "symbols": 5
          },
          "symbols": [
            {
              "name": "is_metal",
              "qualified_name": "is_metal",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const is_metal = builtin.os.tag == .macos",
              "anchor": "is-metal",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/#is-metal",
              "source_path": "src/gpu/interface.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L10",
              "doc": {
                "summary": "True when compiling for macOS (Metal backend).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "True when compiling for macOS (Metal backend)."
              },
              "members": []
            },
            {
              "name": "is_cuda",
              "qualified_name": "is_cuda",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const is_cuda = builtin.os.tag == .linux and std.mem.eql(u8, build_options.backend, \"cuda\")",
              "anchor": "is-cuda",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/#is-cuda",
              "source_path": "src/gpu/interface.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L12",
              "doc": {
                "summary": "True when compiling for Linux with `-Dbackend=cuda` (NVIDIA / WSL2).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "True when compiling for Linux with `-Dbackend=cuda` (NVIDIA / WSL2)."
              },
              "members": []
            },
            {
              "name": "is_vulkan",
              "qualified_name": "is_vulkan",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const is_vulkan = builtin.os.tag == .linux and !is_cuda",
              "anchor": "is-vulkan",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/#is-vulkan",
              "source_path": "src/gpu/interface.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L14",
              "doc": {
                "summary": "True when compiling for Linux with the Vulkan backend (the Linux default).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "True when compiling for Linux with the Vulkan backend (the Linux default)."
              },
              "members": []
            },
            {
              "name": "backend",
              "qualified_name": "backend",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const backend = if (is_metal) @import(\"../metal/device.zig\") else if (is_cuda) @import(\"../cuda/device.zig\") else @import(\"../vulkan/instance.zig\")",
              "anchor": "backend",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/#backend",
              "source_path": "src/gpu/interface.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L19",
              "doc": {
                "summary": "Platform-specific GPU device module (Metal / CUDA / Vulkan).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Platform-specific GPU device module (Metal / CUDA / Vulkan)."
              },
              "members": []
            },
            {
              "name": "vk",
              "qualified_name": "vk",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const vk = if (is_vulkan) @import(\"../vulkan/vk.zig\") else struct}",
              "anchor": "vk",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/interface/#vk",
              "source_path": "src/gpu/interface.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/interface.zig#L27",
              "doc": {
                "summary": "Vulkan C bindings (empty struct off-Vulkan).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Vulkan C bindings (empty struct off-Vulkan)."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "memory-plan",
          "title": "Memory Plan",
          "section": "Inference Runtime",
          "summary": "Shared runtime memory accounting helpers for Vulkan and Metal backends.",
          "overview": [
            "The helpers in this module turn model dimensions plus backend-specific runtime characteristics into a comparable memory budget so diagnostics, server load policy, and inference engines size context and KV consistently."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/",
          "source_path": "src/gpu/memory_plan.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L15",
          "counts": {
            "code_lines": 290,
            "exports": 12,
            "methods": 9,
            "symbols": 21
          },
          "symbols": [
            {
              "name": "RuntimeMemoryProfile",
              "qualified_name": "RuntimeMemoryProfile",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RuntimeMemoryProfile = struct",
              "anchor": "runtime-memory-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L15",
              "doc": {
                "summary": "Backend-agnostic breakdown of runtime memory as: - fixed bytes that do not scale with context length - bytes that scale linearly per token",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Backend-agnostic breakdown of runtime memory as:\n- fixed bytes that do not scale with context length\n- bytes that scale linearly per token"
              },
              "members": [
                {
                  "name": "deviceLocalContextBytes",
                  "qualified_name": "RuntimeMemoryProfile.deviceLocalContextBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deviceLocalContextBytes(self: @This(), context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-device-local-context-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-device-local-context-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 28,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L28",
                  "doc": {
                    "summary": "Return device-local bytes consumed by context-scaled runtime state.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return device-local bytes consumed by context-scaled runtime state."
                  }
                },
                {
                  "name": "hostVisibleContextBytes",
                  "qualified_name": "RuntimeMemoryProfile.hostVisibleContextBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn hostVisibleContextBytes(self: @This(), context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-host-visible-context-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-host-visible-context-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 33,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L33",
                  "doc": {
                    "summary": "Return host-visible bytes consumed by context-scaled runtime state.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return host-visible bytes consumed by context-scaled runtime state."
                  }
                },
                {
                  "name": "runtimeDeviceLocalBytes",
                  "qualified_name": "RuntimeMemoryProfile.runtimeDeviceLocalBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn runtimeDeviceLocalBytes(self: @This(), context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-runtime-device-local-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-runtime-device-local-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 38,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L38",
                  "doc": {
                    "summary": "Return total device-local runtime bytes for the requested context length.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return total device-local runtime bytes for the requested context length."
                  }
                },
                {
                  "name": "runtimeHostVisibleBytes",
                  "qualified_name": "RuntimeMemoryProfile.runtimeHostVisibleBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn runtimeHostVisibleBytes(self: @This(), context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-runtime-host-visible-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-runtime-host-visible-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 43,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L43",
                  "doc": {
                    "summary": "Return total host-visible runtime bytes for the requested context length.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return total host-visible runtime bytes for the requested context length."
                  }
                },
                {
                  "name": "runtimeUnifiedBytes",
                  "qualified_name": "RuntimeMemoryProfile.runtimeUnifiedBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn runtimeUnifiedBytes(self: @This(), context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-runtime-unified-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-runtime-unified-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 48,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L48",
                  "doc": {
                    "summary": "Return total unified-memory runtime bytes for the requested context length.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return total unified-memory runtime bytes for the requested context length."
                  }
                },
                {
                  "name": "totalDeviceLocalBytes",
                  "qualified_name": "RuntimeMemoryProfile.totalDeviceLocalBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn totalDeviceLocalBytes(self: @This(), weights_bytes: u64, context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-total-device-local-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-total-device-local-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 53,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L53",
                  "doc": {
                    "summary": "Return weights plus device-local runtime bytes for the requested context length.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return weights plus device-local runtime bytes for the requested context length."
                  }
                },
                {
                  "name": "totalUnifiedBytes",
                  "qualified_name": "RuntimeMemoryProfile.totalUnifiedBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn totalUnifiedBytes(self: @This(), weights_bytes: u64, context_tokens: u32) u64",
                  "anchor": "runtime-memory-profile-total-unified-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-total-unified-bytes",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 58,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L58",
                  "doc": {
                    "summary": "Return weights plus unified runtime bytes for the requested context length.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return weights plus unified runtime bytes for the requested context length."
                  }
                },
                {
                  "name": "maxContextTokensForDeviceLocalBudget",
                  "qualified_name": "RuntimeMemoryProfile.maxContextTokensForDeviceLocalBudget",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxContextTokensForDeviceLocalBudget( self: @This(), weights_bytes: u64, budget_bytes: u64, ceiling: u32, ) u32",
                  "anchor": "runtime-memory-profile-max-context-tokens-for-device-local-budget",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-max-context-tokens-for-device-local-budget",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 68,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L68",
                  "doc": {
                    "summary": "Return the largest context that fits within a device-local memory budget.",
                    "description": [],
                    "params": [
                      {
                        "name": "weights_bytes",
                        "description": "Size of model weights already placed on the device."
                      },
                      {
                        "name": "budget_bytes",
                        "description": "Total device-local memory budget available."
                      },
                      {
                        "name": "ceiling",
                        "description": "Architectural context-length ceiling (e.g. from GGUF)."
                      }
                    ],
                    "returns": "Token count clamped to both the budget and `ceiling`.",
                    "notes": [],
                    "raw": "Return the largest context that fits within a device-local memory budget."
                  }
                },
                {
                  "name": "maxContextTokensForUnifiedBudget",
                  "qualified_name": "RuntimeMemoryProfile.maxContextTokensForUnifiedBudget",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxContextTokensForUnifiedBudget( self: @This(), weights_bytes: u64, budget_bytes: u64, ceiling: u32, ) u32",
                  "anchor": "runtime-memory-profile-max-context-tokens-for-unified-budget",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#runtime-memory-profile-max-context-tokens-for-unified-budget",
                  "source_path": "src/gpu/memory_plan.zig",
                  "source_line": 92,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L92",
                  "doc": {
                    "summary": "Return the largest context that fits within a unified-memory budget.",
                    "description": [
                      "Combines device-local and host-visible costs (both fixed and per-token) when computing available room, suitable for backends with a single unified address space such as Metal."
                    ],
                    "params": [
                      {
                        "name": "weights_bytes",
                        "description": "Size of model weights counted against the budget."
                      },
                      {
                        "name": "budget_bytes",
                        "description": "Total unified-memory budget available."
                      },
                      {
                        "name": "ceiling",
                        "description": "Architectural context-length ceiling."
                      }
                    ],
                    "returns": "Token count clamped to both the budget and `ceiling`.",
                    "notes": [],
                    "raw": "Return the largest context that fits within a unified-memory budget.\n\nCombines device-local and host-visible costs (both fixed and per-token)\nwhen computing available room, suitable for backends with a single\nunified address space such as Metal."
                  }
                }
              ]
            },
            {
              "name": "effectiveContextCeiling",
              "qualified_name": "effectiveContextCeiling",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn effectiveContextCeiling(config: ModelConfig, requested_context_length: ?u32) u32",
              "anchor": "effective-context-ceiling",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#effective-context-ceiling",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 113,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L113",
              "doc": {
                "summary": "Clamp the requested context length against the model's declared context limit.",
                "description": [],
                "params": [
                  {
                    "name": "config",
                    "description": "Model configuration supplying `context_length` as the hard ceiling."
                  },
                  {
                    "name": "requested_context_length",
                    "description": "Optional caller-supplied cap; `null` means use the model ceiling."
                  }
                ],
                "returns": "The smaller of `config.context_length` and the requested cap.",
                "notes": [],
                "raw": "Clamp the requested context length against the model's declared context limit."
              },
              "members": []
            },
            {
              "name": "applyRequestedContextLimit",
              "qualified_name": "applyRequestedContextLimit",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn applyRequestedContextLimit(config: *ModelConfig, requested_context_length: ?u32) void",
              "anchor": "apply-requested-context-limit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#apply-requested-context-limit",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 123,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L123",
              "doc": {
                "summary": "Apply the requested context cap directly to a mutable model config.",
                "description": [
                  "Mutates `config.context_length` in place so that downstream code reading the config sees the clamped value without needing to carry a separate cap."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Config to mutate; `context_length` is lowered if necessary."
                  },
                  {
                    "name": "requested_context_length",
                    "description": "Optional cap; ignored when larger than the current ceiling."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Apply the requested context cap directly to a mutable model config.\n\nMutates `config.context_length` in place so that downstream code reading\nthe config sees the clamped value without needing to carry a separate cap."
              },
              "members": []
            },
            {
              "name": "requestedContextTokens",
              "qualified_name": "requestedContextTokens",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn requestedContextTokens(config: ModelConfig, requested_context_length: ?u32, backend_cap: u32) u32",
              "anchor": "requested-context-tokens",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#requested-context-tokens",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 135,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L135",
              "doc": {
                "summary": "Return the runtime context target after applying both model and backend caps.",
                "description": [
                  "Applies the model ceiling first (`effectiveContextCeiling`), then further clamps to the backend's hardware-derived limit."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Model configuration providing the architectural ceiling."
                  },
                  {
                    "name": "requested_context_length",
                    "description": "Optional user-supplied context length cap."
                  },
                  {
                    "name": "backend_cap",
                    "description": "Hardware or driver limit reported by the backend."
                  }
                ],
                "returns": "Final context length clamped to all three bounds.",
                "notes": [],
                "raw": "Return the runtime context target after applying both model and backend caps.\n\nApplies the model ceiling first (`effectiveContextCeiling`), then further\nclamps to the backend's hardware-derived limit."
              },
              "members": []
            },
            {
              "name": "remainingContextTokens",
              "qualified_name": "remainingContextTokens",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn remainingContextTokens(used_context_tokens: u32, context_capacity_tokens: u32) u32",
              "anchor": "remaining-context-tokens",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#remaining-context-tokens",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 146,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L146",
              "doc": {
                "summary": "Return how many context slots remain available for a request.",
                "description": [
                  "Uses saturating subtraction so the result is 0 rather than wrapping when `used_context_tokens` exceeds the capacity."
                ],
                "params": [
                  {
                    "name": "used_context_tokens",
                    "description": "Tokens already committed in the current context window."
                  },
                  {
                    "name": "context_capacity_tokens",
                    "description": "Total context window size in tokens."
                  }
                ],
                "returns": "Remaining free slots, clamped to 0 on overflow.",
                "notes": [],
                "raw": "Return how many context slots remain available for a request.\n\nUses saturating subtraction so the result is 0 rather than wrapping when\n`used_context_tokens` exceeds the capacity."
              },
              "members": []
            },
            {
              "name": "clampedCompletionTokens",
              "qualified_name": "clampedCompletionTokens",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn clampedCompletionTokens( used_context_tokens: u32, requested_completion_tokens: u32, context_capacity_tokens: u32, ) u32",
              "anchor": "clamped-completion-tokens",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#clamped-completion-tokens",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 156,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L156",
              "doc": {
                "summary": "Clamp requested completion tokens against the remaining context budget.",
                "description": [],
                "params": [
                  {
                    "name": "used_context_tokens",
                    "description": "Tokens already in the context window."
                  },
                  {
                    "name": "requested_completion_tokens",
                    "description": "Caller-requested number of new tokens to generate."
                  },
                  {
                    "name": "context_capacity_tokens",
                    "description": "Total context capacity."
                  }
                ],
                "returns": "Actual completion quota, never exceeding the remaining room.",
                "notes": [],
                "raw": "Clamp requested completion tokens against the remaining context budget."
              },
              "members": []
            },
            {
              "name": "requestContextTarget",
              "qualified_name": "requestContextTarget",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn requestContextTarget( used_context_tokens: u32, requested_completion_tokens: u32, context_capacity_tokens: u32, ) u32",
              "anchor": "request-context-target",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#request-context-target",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 172,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L172",
              "doc": {
                "summary": "Return the total context target needed for prompt plus completion work.",
                "description": [
                  "Adds the clamped completion quota to the tokens already used, then caps the result at `context_capacity_tokens` to prevent over-allocation."
                ],
                "params": [
                  {
                    "name": "used_context_tokens",
                    "description": "Tokens already occupying the context window."
                  },
                  {
                    "name": "requested_completion_tokens",
                    "description": "Tokens the caller wants to generate."
                  },
                  {
                    "name": "context_capacity_tokens",
                    "description": "Hard upper bound on the context window size."
                  }
                ],
                "returns": "Total tokens to allocate, bounded by capacity.",
                "notes": [],
                "raw": "Return the total context target needed for prompt plus completion work.\n\nAdds the clamped completion quota to the tokens already used, then caps\nthe result at `context_capacity_tokens` to prevent over-allocation."
              },
              "members": []
            },
            {
              "name": "RequestBudget",
              "qualified_name": "RequestBudget",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RequestBudget = struct",
              "anchor": "request-budget",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#request-budget",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 184,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L184",
              "doc": {
                "summary": "Completion-token budget and resulting context target for one request.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Completion-token budget and resulting context target for one request."
              },
              "members": []
            },
            {
              "name": "requestBudget",
              "qualified_name": "requestBudget",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn requestBudget( used_context_tokens: u32, requested_completion_tokens: u32, context_capacity_tokens: u32, ) RequestBudget",
              "anchor": "request-budget",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#request-budget",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 198,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L198",
              "doc": {
                "summary": "Compute the clamped completion budget and resulting context target for one request.",
                "description": [
                  "Combines `clampedCompletionTokens` and `requestContextTarget` into a single call so callers get both values in one pass. total context window size to allocate for this request."
                ],
                "params": [
                  {
                    "name": "used_context_tokens",
                    "description": "Tokens already committed in the context window."
                  },
                  {
                    "name": "requested_completion_tokens",
                    "description": "Tokens the caller wants to generate."
                  },
                  {
                    "name": "context_capacity_tokens",
                    "description": "Total context capacity."
                  }
                ],
                "returns": "`RequestBudget` with the actual completion quota and the",
                "notes": [],
                "raw": "Compute the clamped completion budget and resulting context target for one request.\n\nCombines `clampedCompletionTokens` and `requestContextTarget` into a single\ncall so callers get both values in one pass.\ntotal context window size to allocate for this request."
              },
              "members": []
            },
            {
              "name": "profile",
              "qualified_name": "profile",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn profile(config: ModelConfig) RuntimeMemoryProfile",
              "anchor": "profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#profile",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 225,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L225",
              "doc": {
                "summary": "Build the backend-agnostic runtime memory profile for a normalized model config.",
                "description": [
                  "Computes all fixed and per-token memory costs from model dimensions, including attention buffers, FFN/MoE scratch buffers, SSM convolution and state buffers, and KV-cache scaling. The returned profile does not include model weights."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "Model configuration with dimensions, expert counts, and SSM parameters."
                  }
                ],
                "returns": "`RuntimeMemoryProfile` capturing fixed overhead and per-token KV cost.",
                "notes": [],
                "raw": "Build the backend-agnostic runtime memory profile for a normalized model config.\n\nComputes all fixed and per-token memory costs from model dimensions, including\nattention buffers, FFN/MoE scratch buffers, SSM convolution and state buffers,\nand KV-cache scaling. The returned profile does not include model weights."
              },
              "members": []
            },
            {
              "name": "auto_context_floor_tokens",
              "qualified_name": "auto_context_floor_tokens",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const auto_context_floor_tokens: u32 = 4096",
              "anchor": "auto-context-floor-tokens",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#auto-context-floor-tokens",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 298,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L298",
              "doc": {
                "summary": "vLLM-style floor for auto-sized context: never fall below this even if the memory math suggests less — the server would otherwise become unusable.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "vLLM-style floor for auto-sized context: never fall below this even if\nthe memory math suggests less — the server would otherwise become unusable."
              },
              "members": []
            },
            {
              "name": "autoContextTokensForDeviceBudget",
              "qualified_name": "autoContextTokensForDeviceBudget",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn autoContextTokensForDeviceBudget( profile_value: RuntimeMemoryProfile, weights_bytes: u64, device_budget_bytes: u64, architectural_ceiling: u32, ) u32",
              "anchor": "auto-context-tokens-for-device-budget",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/memory-plan/#auto-context-tokens-for-device-budget",
              "source_path": "src/gpu/memory_plan.zig",
              "source_line": 324,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/memory_plan.zig#L324",
              "doc": {
                "summary": "Derive a context length from an available device-memory budget.",
                "description": [
                  "Analogous to vLLM's `determine_available_memory` → `get_num_blocks` flow, adapted for a contiguous (non-paged) KV cache: 1. Reserve a utilization fraction of the device budget. 2. Subtract model weights and fixed runtime overhead. 3. Divide the leftover by the per-token KV cost. 4. Clamp to the architectural ceiling from GGUF and floor at 4096 so tiny or very-tight budgets still produce a usable server."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Derive a context length from an available device-memory budget.\n\nAnalogous to vLLM's `determine_available_memory` → `get_num_blocks` flow,\nadapted for a contiguous (non-paged) KV cache:\n1. Reserve a utilization fraction of the device budget.\n2. Subtract model weights and fixed runtime overhead.\n3. Divide the leftover by the per-token KV cost.\n4. Clamp to the architectural ceiling from GGUF and floor at 4096 so\ntiny or very-tight budgets still produce a usable server."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "process-lock",
          "title": "Process Lock",
          "section": "Inference Runtime",
          "summary": "Cross-process GPU reservation lock keyed by backend and selected device.",
          "overview": [
            "ZINC uses a filesystem lock to stop multiple inference processes from loading different models onto the same physical GPU at once, which would otherwise produce confusing OOM failures and unstable benchmark results."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/",
          "source_path": "src/gpu/process_lock.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L10",
          "counts": {
            "code_lines": 48,
            "exports": 5,
            "methods": 2,
            "symbols": 7
          },
          "symbols": [
            {
              "name": "Backend",
              "qualified_name": "Backend",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Backend = enum",
              "anchor": "backend",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#backend",
              "source_path": "src/gpu/process_lock.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L10",
              "doc": {
                "summary": "Backend identifier encoded into the shared GPU lockfile name.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Backend identifier encoded into the shared GPU lockfile name."
              },
              "members": []
            },
            {
              "name": "ProcessLock",
              "qualified_name": "ProcessLock",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ProcessLock = struct",
              "anchor": "process-lock",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#process-lock",
              "source_path": "src/gpu/process_lock.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L16",
              "doc": {
                "summary": "Cross-process lock handle that reserves one backend/device pair.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Cross-process lock handle that reserves one backend/device pair."
              },
              "members": [
                {
                  "name": "isHeld",
                  "qualified_name": "ProcessLock.isHeld",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isHeld(self: *const ProcessLock) bool",
                  "anchor": "process-lock-is-held",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#process-lock-is-held",
                  "source_path": "src/gpu/process_lock.zig",
                  "source_line": 20,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L20",
                  "doc": {
                    "summary": "Return whether the lock currently owns an open lockfile handle.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether the lock currently owns an open lockfile handle."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ProcessLock.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ProcessLock) void",
                  "anchor": "process-lock-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#process-lock-deinit",
                  "source_path": "src/gpu/process_lock.zig",
                  "source_line": 25,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L25",
                  "doc": {
                    "summary": "Release the held lockfile handle, if any.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the held lockfile handle, if any."
                  }
                }
              ]
            },
            {
              "name": "AcquireError",
              "qualified_name": "AcquireError",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AcquireError = std.fs.File.OpenError || error{",
              "anchor": "acquire-error",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#acquire-error",
              "source_path": "src/gpu/process_lock.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L34",
              "doc": {
                "summary": "Errors returned while acquiring a backend/device GPU reservation lock.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Errors returned while acquiring a backend/device GPU reservation lock."
              },
              "members": []
            },
            {
              "name": "lockPath",
              "qualified_name": "lockPath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn lockPath(buffer: []u8, backend: Backend, device_index: u32) error{LockPathTooLong}![]const u8",
              "anchor": "lock-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#lock-path",
              "source_path": "src/gpu/process_lock.zig",
              "source_line": 46,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L46",
              "doc": {
                "summary": "Format the lockfile path for a backend/device pair into the caller-supplied buffer.",
                "description": [],
                "params": [
                  {
                    "name": "buffer",
                    "description": "Destination slice for the formatted path; must be large enough to hold the formatted path."
                  },
                  {
                    "name": "backend",
                    "description": "The GPU backend whose tag name is embedded in the path."
                  },
                  {
                    "name": "device_index",
                    "description": "Zero-based device index embedded in the path."
                  }
                ],
                "returns": "A slice into `buffer` holding the formatted path string, e.g. `/tmp/zinc-gpu-vulkan-0.lock`.",
                "notes": [
                  "Returns `error.LockPathTooLong` if `buffer` is too small to hold the formatted path."
                ],
                "raw": "Format the lockfile path for a backend/device pair into the caller-supplied buffer."
              },
              "members": []
            },
            {
              "name": "acquire",
              "qualified_name": "acquire",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn acquire(backend: Backend, device_index: u32) AcquireError!ProcessLock",
              "anchor": "acquire",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/process-lock/#acquire",
              "source_path": "src/gpu/process_lock.zig",
              "source_line": 63,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/gpu/process_lock.zig#L63",
              "doc": {
                "summary": "Acquire the cross-process GPU reservation lock for a backend/device pair.",
                "description": [
                  "Opens the lockfile in non-blocking exclusive mode so that a second process attempting to claim the same GPU immediately receives `error.GpuAlreadyReserved` rather than blocking indefinitely."
                ],
                "params": [
                  {
                    "name": "backend",
                    "description": "The GPU backend to reserve."
                  },
                  {
                    "name": "device_index",
                    "description": "Zero-based index of the device to reserve within that backend."
                  }
                ],
                "returns": "A `ProcessLock` holding the open lockfile handle; caller must call `deinit` to release.",
                "notes": [
                  "Returns `error.GpuAlreadyReserved` if another process already holds the lock."
                ],
                "raw": "Acquire the cross-process GPU reservation lock for a backend/device pair.\n\nOpens the lockfile in non-blocking exclusive mode so that a second process\nattempting to claim the same GPU immediately receives `error.GpuAlreadyReserved`\nrather than blocking indefinitely."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "batching",
          "title": "Batching",
          "section": "Inference Runtime",
          "summary": "Tenant-aware batch planning for ZINC_RT.",
          "overview": [
            "This module owns admission, quotas, and prefill/decode batch selection. It is intentionally independent of the current host-assisted `forward_zinc_rt` execution path so it can be validated before the M3 continuous-batching executor consumes it."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/",
          "source_path": "src/zinc_rt/batching.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L11",
          "counts": {
            "code_lines": 376,
            "exports": 9,
            "methods": 14,
            "symbols": 23
          },
          "symbols": [
            {
              "name": "TenantId",
              "qualified_name": "TenantId",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const TenantId = u32",
              "anchor": "tenant-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#tenant-id",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L11",
              "doc": {
                "summary": "Stable tenant identifier supplied by the API/server layer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Stable tenant identifier supplied by the API/server layer."
              },
              "members": []
            },
            {
              "name": "RequestId",
              "qualified_name": "RequestId",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const RequestId = u64",
              "anchor": "request-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#request-id",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L13",
              "doc": {
                "summary": "Monotonic request identifier assigned at admission.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Monotonic request identifier assigned at admission."
              },
              "members": []
            },
            {
              "name": "TenantLimits",
              "qualified_name": "TenantLimits",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const TenantLimits = struct",
              "anchor": "tenant-limits",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#tenant-limits",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L16",
              "doc": {
                "summary": "Per-tenant admission and scheduling limits.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-tenant admission and scheduling limits."
              },
              "members": []
            },
            {
              "name": "RequestConfig",
              "qualified_name": "RequestConfig",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RequestConfig = struct",
              "anchor": "request-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#request-config",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L26",
              "doc": {
                "summary": "Request metadata needed by the ZINC_RT batch planner.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Request metadata needed by the ZINC_RT batch planner."
              },
              "members": []
            },
            {
              "name": "RequestState",
              "qualified_name": "RequestState",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const RequestState = enum",
              "anchor": "request-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#request-state",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L36",
              "doc": {
                "summary": "Lifecycle tracked by the ZINC_RT batch planner.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Lifecycle tracked by the ZINC_RT batch planner."
              },
              "members": []
            },
            {
              "name": "Slot",
              "qualified_name": "Slot",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Slot = struct",
              "anchor": "slot",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#slot",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L50",
              "doc": {
                "summary": "One request slot in the multitenant planner.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One request slot in the multitenant planner."
              },
              "members": [
                {
                  "name": "promptRemaining",
                  "qualified_name": "Slot.promptRemaining",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn promptRemaining(self: Slot) u32",
                  "anchor": "slot-prompt-remaining",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#slot-prompt-remaining",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 67,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L67",
                  "doc": {
                    "summary": "Remaining prompt tokens.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Remaining prompt tokens."
                  }
                },
                {
                  "name": "decodeDone",
                  "qualified_name": "Slot.decodeDone",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn decodeDone(self: Slot) bool",
                  "anchor": "slot-decode-done",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#slot-decode-done",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L72",
                  "doc": {
                    "summary": "Whether decode has reached the configured maximum.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Whether decode has reached the configured maximum."
                  }
                }
              ]
            },
            {
              "name": "BatchKind",
              "qualified_name": "BatchKind",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const BatchKind = enum",
              "anchor": "batch-kind",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-kind",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 78,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L78",
              "doc": {
                "summary": "Type of work represented by a batch entry.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Type of work represented by a batch entry."
              },
              "members": []
            },
            {
              "name": "BatchEntry",
              "qualified_name": "BatchEntry",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BatchEntry = struct",
              "anchor": "batch-entry",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-entry",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 84,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L84",
              "doc": {
                "summary": "One request inside a selected prefill or decode batch.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One request inside a selected prefill or decode batch."
              },
              "members": []
            },
            {
              "name": "BatchScheduler",
              "qualified_name": "BatchScheduler",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BatchScheduler = struct",
              "anchor": "batch-scheduler",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler",
              "source_path": "src/zinc_rt/batching.zig",
              "source_line": 102,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L102",
              "doc": {
                "summary": "Fixed-capacity multitenant scheduler for ZINC_RT prefill/decode batches.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fixed-capacity multitenant scheduler for ZINC_RT prefill/decode batches."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "BatchScheduler.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, max_slots: u32, max_tenants: u32) !BatchScheduler",
                  "anchor": "batch-scheduler-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-init",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 114,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L114",
                  "doc": {
                    "summary": "Initialize a fixed-capacity scheduler.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator for slot and tenant arrays."
                      },
                      {
                        "name": "max_slots",
                        "description": "Maximum live requests across all tenants."
                      },
                      {
                        "name": "max_tenants",
                        "description": "Maximum registered tenants."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Initialize a fixed-capacity scheduler."
                  }
                },
                {
                  "name": "registerTenant",
                  "qualified_name": "BatchScheduler.registerTenant",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn registerTenant(self: *BatchScheduler, tenant_id: TenantId, limits: TenantLimits) !void",
                  "anchor": "batch-scheduler-register-tenant",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-register-tenant",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 136,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L136",
                  "doc": {
                    "summary": "Register or update limits for a tenant.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to mutate."
                      },
                      {
                        "name": "tenant_id",
                        "description": "Tenant identifier."
                      },
                      {
                        "name": "limits",
                        "description": "New tenant limits."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Register or update limits for a tenant."
                  }
                },
                {
                  "name": "submit",
                  "qualified_name": "BatchScheduler.submit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn submit(self: *BatchScheduler, config: RequestConfig) !u32",
                  "anchor": "batch-scheduler-submit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-submit",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 161,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L161",
                  "doc": {
                    "summary": "Submit a request into the first free slot.",
                    "description": [],
                    "params": [],
                    "returns": "Assigned slot ID.",
                    "notes": [],
                    "raw": "Submit a request into the first free slot."
                  }
                },
                {
                  "name": "selectPrefillBatch",
                  "qualified_name": "BatchScheduler.selectPrefillBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn selectPrefillBatch(self: *BatchScheduler, out: []BatchEntry, max_prompt_tokens: u32) []BatchEntry",
                  "anchor": "batch-scheduler-select-prefill-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-select-prefill-batch",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 193,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L193",
                  "doc": {
                    "summary": "Select queued/prefilling requests for prompt prefill.",
                    "description": [],
                    "params": [
                      {
                        "name": "out",
                        "description": "Caller-owned scratch for entries."
                      },
                      {
                        "name": "max_prompt_tokens",
                        "description": "Total prompt-token budget for this batch."
                      }
                    ],
                    "returns": "A slice of `out` with selected prefill entries.",
                    "notes": [],
                    "raw": "Select queued/prefilling requests for prompt prefill."
                  }
                },
                {
                  "name": "advancePrefill",
                  "qualified_name": "BatchScheduler.advancePrefill",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn advancePrefill(self: *BatchScheduler, slot_id: u32, tokens: u32) !void",
                  "anchor": "batch-scheduler-advance-prefill",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-advance-prefill",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 240,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L240",
                  "doc": {
                    "summary": "Account for completed prompt work.",
                    "description": [],
                    "params": [
                      {
                        "name": "slot_id",
                        "description": "Slot that consumed prompt tokens."
                      },
                      {
                        "name": "tokens",
                        "description": "Number of prompt tokens consumed."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Account for completed prompt work."
                  }
                },
                {
                  "name": "selectDecodeBatch",
                  "qualified_name": "BatchScheduler.selectDecodeBatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn selectDecodeBatch(self: *BatchScheduler, out: []BatchEntry, max_slots: u32) []BatchEntry",
                  "anchor": "batch-scheduler-select-decode-batch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-select-decode-batch",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 254,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L254",
                  "doc": {
                    "summary": "Select active decode requests fairly across slots and tenant limits.",
                    "description": [],
                    "params": [
                      {
                        "name": "out",
                        "description": "Caller-owned scratch for entries."
                      },
                      {
                        "name": "max_slots",
                        "description": "Maximum entries to select."
                      }
                    ],
                    "returns": "A slice of `out` with selected decode entries.",
                    "notes": [],
                    "raw": "Select active decode requests fairly across slots and tenant limits."
                  }
                },
                {
                  "name": "recordDecodeToken",
                  "qualified_name": "BatchScheduler.recordDecodeToken",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordDecodeToken(self: *BatchScheduler, slot_id: u32) !void",
                  "anchor": "batch-scheduler-record-decode-token",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-record-decode-token",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 290,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L290",
                  "doc": {
                    "summary": "Account for one generated decode token.",
                    "description": [],
                    "params": [
                      {
                        "name": "slot_id",
                        "description": "Slot that emitted a token."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Account for one generated decode token."
                  }
                },
                {
                  "name": "cancel",
                  "qualified_name": "BatchScheduler.cancel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn cancel(self: *BatchScheduler, slot_id: u32) !void",
                  "anchor": "batch-scheduler-cancel",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-cancel",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 302,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L302",
                  "doc": {
                    "summary": "Mark a request as cancelled.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Mark a request as cancelled."
                  }
                },
                {
                  "name": "release",
                  "qualified_name": "BatchScheduler.release",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn release(self: *BatchScheduler, slot_id: u32) void",
                  "anchor": "batch-scheduler-release",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-release",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 308,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L308",
                  "doc": {
                    "summary": "Release a completed or cancelled slot.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release a completed or cancelled slot."
                  }
                },
                {
                  "name": "activeCount",
                  "qualified_name": "BatchScheduler.activeCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activeCount(self: *const BatchScheduler) u32",
                  "anchor": "batch-scheduler-active-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-active-count",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 322,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L322",
                  "doc": {
                    "summary": "Number of occupied request slots.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Number of occupied request slots."
                  }
                },
                {
                  "name": "tenantActiveCount",
                  "qualified_name": "BatchScheduler.tenantActiveCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn tenantActiveCount(self: *const BatchScheduler, tenant_id: TenantId) u32",
                  "anchor": "batch-scheduler-tenant-active-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-tenant-active-count",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 331,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L331",
                  "doc": {
                    "summary": "Number of live requests owned by `tenant_id`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Number of live requests owned by `tenant_id`."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "BatchScheduler.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *BatchScheduler) void",
                  "anchor": "batch-scheduler-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/batching/#batch-scheduler-deinit",
                  "source_path": "src/zinc_rt/batching.zig",
                  "source_line": 337,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/batching.zig#L337",
                  "doc": {
                    "summary": "Free all planner storage.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Free all planner storage."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "engine",
          "title": "Engine",
          "section": "Inference Runtime",
          "summary": "ZINC_RT — the ZINC Runtime.",
          "overview": [
            "Owns tier selection and the top-level runtime handle used by future IR emitters and ring backends."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/",
          "source_path": "src/zinc_rt/engine.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L16",
          "counts": {
            "code_lines": 100,
            "exports": 9,
            "methods": 3,
            "symbols": 12
          },
          "symbols": [
            {
              "name": "Tier",
              "qualified_name": "Tier",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Tier = enum",
              "anchor": "tier",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#tier",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L16",
              "doc": {
                "summary": "Execution tier the engine will dispatch through.",
                "description": [
                  "`t1_pm4` and `t2_umq` are the two direct AMDGPU paths; `t_cpu` is the reference scalar fallback; `t_metal`, `t_intel`, and `t_cuda` are reserved for the corresponding native backends."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Execution tier the engine will dispatch through.\n`t1_pm4` and `t2_umq` are the two direct AMDGPU paths; `t_cpu` is the\nreference scalar fallback; `t_metal`, `t_intel`, and `t_cuda` are reserved\nfor the corresponding native backends."
              },
              "members": []
            },
            {
              "name": "Options",
              "qualified_name": "Options",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Options = struct",
              "anchor": "options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#options",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L27",
              "doc": {
                "summary": "Caller-supplied configuration for `Engine.init`.",
                "description": [
                  "Currently just the desired tier; future fields (worker counts, ring depths, telemetry hooks) live here."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Caller-supplied configuration for `Engine.init`. Currently just the desired\ntier; future fields (worker counts, ring depths, telemetry hooks) live here."
              },
              "members": []
            },
            {
              "name": "Capabilities",
              "qualified_name": "Capabilities",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Capabilities = struct",
              "anchor": "capabilities",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#capabilities",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L34",
              "doc": {
                "summary": "Runtime capability bits surfaced to harnesses and server integration code.",
                "description": [
                  "The batch planner is present, but continuous batched model execution is not wired into `forward_zinc_rt` yet."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Runtime capability bits surfaced to harnesses and server integration code.\nThe batch planner is present, but continuous batched model execution is not\nwired into `forward_zinc_rt` yet."
              },
              "members": []
            },
            {
              "name": "supports_multitenant_batch_planning",
              "qualified_name": "supports_multitenant_batch_planning",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const supports_multitenant_batch_planning = true",
              "anchor": "supports-multitenant-batch-planning",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#supports-multitenant-batch-planning",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 46,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L46",
              "doc": {
                "summary": "True when ZINC_RT can plan multitenant batches.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "True when ZINC_RT can plan multitenant batches."
              },
              "members": []
            },
            {
              "name": "supports_multitenant_batched_execution",
              "qualified_name": "supports_multitenant_batched_execution",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const supports_multitenant_batched_execution = false",
              "anchor": "supports-multitenant-batched-execution",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#supports-multitenant-batched-execution",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L50",
              "doc": {
                "summary": "True only when ZINC_RT can execute multiple tenants in one continuous inference loop.",
                "description": [
                  "This remains false until M3 wires the planner into `forward_zinc_rt` and the server runtime."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "True only when ZINC_RT can execute multiple tenants in one continuous\ninference loop. This remains false until M3 wires the planner into\n`forward_zinc_rt` and the server runtime."
              },
              "members": []
            },
            {
              "name": "Engine",
              "qualified_name": "Engine",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Engine = struct",
              "anchor": "engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#engine",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 54,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L54",
              "doc": {
                "summary": "Top-level runtime handle.",
                "description": [
                  "Owns the allocator the engine was built with and the selected tier; future revisions will also own the ring backend."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Top-level runtime handle. Owns the allocator the engine was built with and\nthe selected tier; future revisions will also own the ring backend."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Engine.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, options: Options) !Engine",
                  "anchor": "engine-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#engine-init",
                  "source_path": "src/zinc_rt/engine.zig",
                  "source_line": 62,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L62",
                  "doc": {
                    "summary": "Construct an engine pinned to the requested tier.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator used for any engine-owned state."
                      },
                      {
                        "name": "options",
                        "description": "Configuration block; `options.tier` selects the backend."
                      }
                    ],
                    "returns": "A ready-to-use `Engine`.",
                    "notes": [],
                    "raw": "Construct an engine pinned to the requested tier."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Engine.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Engine) void",
                  "anchor": "engine-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#engine-deinit",
                  "source_path": "src/zinc_rt/engine.zig",
                  "source_line": 71,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L71",
                  "doc": {
                    "summary": "Release any engine-owned state and poison the handle.",
                    "description": [
                      "Safe to call once per successful `init`."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release any engine-owned state and poison the handle. Safe to call\nonce per successful `init`."
                  }
                },
                {
                  "name": "capabilities",
                  "qualified_name": "Engine.capabilities",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn capabilities(self: *const Engine) Capabilities",
                  "anchor": "engine-capabilities",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#engine-capabilities",
                  "source_path": "src/zinc_rt/engine.zig",
                  "source_line": 76,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L76",
                  "doc": {
                    "summary": "Return static runtime capability bits for the selected build.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return static runtime capability bits for the selected build."
                  }
                }
              ]
            },
            {
              "name": "parseTier",
              "qualified_name": "parseTier",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseTier(value: []const u8) !Tier",
              "anchor": "parse-tier",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#parse-tier",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 88,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L88",
              "doc": {
                "summary": "Parse a textual tier identifier (e.g.",
                "description": [
                  "from `ZINC_RT_TIER` or a CLI flag) into a `Tier`. Accepts both short (`t1`, `t2`) and canonical (`t1_pm4`, `t2_umq`) names; `auto` defers to `autoTier`. not a recognised name."
                ],
                "params": [
                  {
                    "name": "value",
                    "description": "String to parse."
                  }
                ],
                "returns": "The selected `Tier`, or `error.UnknownZincRtTier` if `value` is",
                "notes": [],
                "raw": "Parse a textual tier identifier (e.g. from `ZINC_RT_TIER` or a CLI flag)\ninto a `Tier`. Accepts both short (`t1`, `t2`) and canonical (`t1_pm4`,\n`t2_umq`) names; `auto` defers to `autoTier`.\nnot a recognised name."
              },
              "members": []
            },
            {
              "name": "tierFromEnv",
              "qualified_name": "tierFromEnv",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn tierFromEnv() !Tier",
              "anchor": "tier-from-env",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#tier-from-env",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 101,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L101",
              "doc": {
                "summary": "Read `ZINC_RT_TIER` and parse it, falling back to `autoTier` when unset.",
                "description": [],
                "params": [],
                "returns": "The selected `Tier`, or a parse error from `parseTier`.",
                "notes": [],
                "raw": "Read `ZINC_RT_TIER` and parse it, falling back to `autoTier` when unset."
              },
              "members": []
            },
            {
              "name": "autoTier",
              "qualified_name": "autoTier",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn autoTier() Tier",
              "anchor": "auto-tier",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/engine/#auto-tier",
              "source_path": "src/zinc_rt/engine.zig",
              "source_line": 113,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/engine.zig#L113",
              "doc": {
                "summary": "Probe the host for direct-execution paths and return the best available tier.",
                "description": [
                  "Tries T2 UMQ first (the blessed AMDGPU user-queue path), falls back to T1 PM4 over `/dev/kfd` when UMQ admission is refused, and finally to the scalar CPU reference. so T2 admission usually fails and we end up on T1 PM4."
                ],
                "params": [],
                "returns": "The best tier the current host can run today.",
                "notes": [
                  "On the bench node the amdgpu firmware rejects compute user queues,"
                ],
                "raw": "Probe the host for direct-execution paths and return the best available\ntier. Tries T2 UMQ first (the blessed AMDGPU user-queue path), falls back\nto T1 PM4 over `/dev/kfd` when UMQ admission is refused, and finally to\nthe scalar CPU reference.\nso T2 admission usually fails and we end up on T1 PM4."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "fast-pool",
          "title": "Fast Pool",
          "section": "Inference Runtime",
          "summary": "Low-overhead worker pool for the T-CPU decode matvec fan-out.",
          "overview": [
            "Replaces std.Thread.Pool's spawnWg/waitAndWork pattern for the matvec hot path. Each dispatch posts up to N typed tasks to per-worker atomic slots and spins on a per-slot done-sequence — no heap allocation, no mutex, no condvar. Workers are persistent and spin (with brief yields) between dispatches; total CPU footprint is bounded by `n_workers` cores.",
            "Why bother: the Qwen3.6-MoE+SSM decode dispatches ~200 matvec/fan-out barriers per token through std.Thread.Pool. Each spawnWg does a heap allocation on the global smp_allocator (closure container), takes the pool mutex twice, and signals a condvar; each waitAndWork takes the mutex and waits on a ResetEvent futex. The atomic-only path here is orders of magnitude cheaper per barrier (~tens of ns vs ~µs).",
            "API: build a small `Task` array, call `dispatchAndRun(&tasks)`. The caller runs `tasks[0]` on the main thread; `tasks[1..n]` are posted to workers 0..n-1. Returns when all tasks have completed."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/",
          "source_path": "src/zinc_rt/fast_pool.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L27",
          "counts": {
            "code_lines": 150,
            "exports": 3,
            "methods": 4,
            "symbols": 7
          },
          "symbols": [
            {
              "name": "max_workers",
              "qualified_name": "max_workers",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const max_workers: usize = 16",
              "anchor": "max-workers",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#max-workers",
              "source_path": "src/zinc_rt/fast_pool.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L27",
              "doc": {
                "summary": "Upper bound on worker threads supported by a single `FastPool`.",
                "description": [
                  "The slot table is sized to this constant so dispatches stay branch-free and cache-friendly; this matches the decode matvec scheduler's current maximum so high-core hosts do not silently fall back to std.Thread.Pool."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Upper bound on worker threads supported by a single `FastPool`.\nThe slot table is sized to this constant so dispatches stay branch-free\nand cache-friendly; this matches the decode matvec scheduler's current\nmaximum so high-core hosts do not silently fall back to std.Thread.Pool."
              },
              "members": []
            },
            {
              "name": "Task",
              "qualified_name": "Task",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Task = struct",
              "anchor": "task",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#task",
              "source_path": "src/zinc_rt/fast_pool.zig",
              "source_line": 47,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L47",
              "doc": {
                "summary": "Single unit of work posted into the pool.",
                "description": [
                  "`fn_` is invoked with `ctx` on either the calling thread (task 0) or a worker thread (tasks 1..). The caller owns the storage `ctx` points at and must keep it alive until `dispatchAndRun` returns."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Single unit of work posted into the pool.\n`fn_` is invoked with `ctx` on either the calling thread (task 0) or a\nworker thread (tasks 1..). The caller owns the storage `ctx` points at\nand must keep it alive until `dispatchAndRun` returns."
              },
              "members": []
            },
            {
              "name": "FastPool",
              "qualified_name": "FastPool",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FastPool = struct",
              "anchor": "fast-pool",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#fast-pool",
              "source_path": "src/zinc_rt/fast_pool.zig",
              "source_line": 55,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L55",
              "doc": {
                "summary": "Persistent worker pool that fans matvec barriers out across N threads.",
                "description": [
                  "Slots are cache-line aligned and communicated via release/acquire atomics; see the module doc for the rationale and benchmark numbers."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Persistent worker pool that fans matvec barriers out across N threads.\nSlots are cache-line aligned and communicated via release/acquire atomics;\nsee the module doc for the rationale and benchmark numbers."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "FastPool.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(self: *Self, allocator: std.mem.Allocator, n_workers: usize) !void",
                  "anchor": "fast-pool-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#fast-pool-init",
                  "source_path": "src/zinc_rt/fast_pool.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L72",
                  "doc": {
                    "summary": "Spawn `n_workers` persistent worker threads bound to this pool.",
                    "description": [
                      "Initializes the slot table, then launches each worker on `workerMain`. the stack. or a spawn error from `std.Thread.spawn`."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Pool storage; written in place so callers can keep it on"
                      },
                      {
                        "name": "allocator",
                        "description": "Used for the `threads` array only."
                      },
                      {
                        "name": "n_workers",
                        "description": "Worker thread count; must be in `1..=max_workers`."
                      }
                    ],
                    "returns": "`error.InvalidWorkerCount` when `n_workers` is out of range,",
                    "notes": [],
                    "raw": "Spawn `n_workers` persistent worker threads bound to this pool.\nInitializes the slot table, then launches each worker on `workerMain`.\nthe stack.\nor a spawn error from `std.Thread.spawn`."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "FastPool.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Self) void",
                  "anchor": "fast-pool-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#fast-pool-deinit",
                  "source_path": "src/zinc_rt/fast_pool.zig",
                  "source_line": 106,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L106",
                  "doc": {
                    "summary": "Signal shutdown, wake every worker, join all threads, and free state.",
                    "description": [
                      "Bumps each slot's `seq` after raising the shutdown flag so workers observing a spin-loop step out and exit promptly."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Signal shutdown, wake every worker, join all threads, and free state.\nBumps each slot's `seq` after raising the shutdown flag so workers\nobserving a spin-loop step out and exit promptly."
                  }
                },
                {
                  "name": "dispatchAndRun",
                  "qualified_name": "FastPool.dispatchAndRun",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchAndRun(self: *Self, tasks: []const Task) void",
                  "anchor": "fast-pool-dispatch-and-run",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#fast-pool-dispatch-and-run",
                  "source_path": "src/zinc_rt/fast_pool.zig",
                  "source_line": 125,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L125",
                  "doc": {
                    "summary": "Post `tasks[1..]` to worker slots and run `tasks[0]` on the calling thread.",
                    "description": [
                      "Spins on each worker's done-sequence until all tasks have completed, then returns. `tasks[1..n]` are posted to workers 0..n-1 via atomic slot writes. assert, not a returned error. Passing an empty slice is a no-op."
                    ],
                    "params": [
                      {
                        "name": "tasks",
                        "description": "Slice of tasks to execute. `tasks[0]` runs on the caller;"
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "`tasks.len` must be `<= n_workers + 1`; the assertion is a hard"
                    ],
                    "raw": "Post `tasks[1..]` to worker slots and run `tasks[0]` on the calling thread.\nSpins on each worker's done-sequence until all tasks have completed, then returns.\n`tasks[1..n]` are posted to workers 0..n-1 via atomic slot writes.\nassert, not a returned error. Passing an empty slice is a no-op."
                  }
                },
                {
                  "name": "executorCount",
                  "qualified_name": "FastPool.executorCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn executorCount(self: *const Self) usize",
                  "anchor": "fast-pool-executor-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/fast-pool/#fast-pool-executor-count",
                  "source_path": "src/zinc_rt/fast_pool.zig",
                  "source_line": 174,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/fast_pool.zig#L174",
                  "doc": {
                    "summary": "Return the total number of execution contexts available: worker threads plus the calling thread.",
                    "description": [
                      "Use this value to size task arrays passed to `dispatchAndRun`."
                    ],
                    "params": [],
                    "returns": "`n_workers + 1`.",
                    "notes": [],
                    "raw": "Return the total number of execution contexts available: worker threads plus the calling thread.\nUse this value to size task arrays passed to `dispatchAndRun`."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "dequant",
          "title": "Dequant",
          "section": "Inference Runtime",
          "summary": "Shared scalar GGML dequantization helpers for T-CPU kernels.",
          "overview": [
            "These helpers intentionally mirror the Vulkan backend's CPU diagnostic dequantization so M0 can compare host-side ZINC_RT ops against it."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/",
          "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L33",
          "counts": {
            "code_lines": 1443,
            "exports": 13,
            "methods": 0,
            "symbols": 13
          },
          "symbols": [
            {
              "name": "row",
              "qualified_name": "row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn row(raw_data: []const u8, row_index: u32, cols: u32, tensor_type: GGMLType, output: []f32) !void",
              "anchor": "row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 33,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L33",
              "doc": {
                "summary": "Dequantize one row of a GGML tensor into f32 lanes.",
                "description": [
                  "Dispatches on `tensor_type` and writes the first `cols` entries of `output`. Supports the formats used by ZINC weights today: `.f32`, `.f16`, `.bf16`, `.q8_0`, `.q4_0`, `.q5_1`, `.q4_k`, `.q5_k`, `.q6_k`, and `.mxfp4`. their block size (32 for q4_0/q5_1/q8_0/mxfp4, 256 for q4_k/q5_k/q6_k). `error.InputTooSmall` when the row would overrun `raw_data`, `error.UnsupportedShape` on bad alignment, or `error.UnsupportedTensorType` for formats not handled here."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw tensor bytes for the full matrix."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to materialize."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns per row; quantized formats require this to be a multiple of"
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization tag selecting the decode path."
                  },
                  {
                    "name": "output",
                    "description": "Destination slice; must be at least `cols` long."
                  }
                ],
                "returns": "`error.OutputTooSmall` when `output.len < cols`, `error.EmptyInput` when `cols == 0`,",
                "notes": [],
                "raw": "Dequantize one row of a GGML tensor into f32 lanes.\nDispatches on `tensor_type` and writes the first `cols` entries of `output`. Supports the\nformats used by ZINC weights today: `.f32`, `.f16`, `.bf16`, `.q8_0`, `.q4_0`, `.q5_1`,\n`.q4_k`, `.q5_k`, `.q6_k`, and `.mxfp4`.\ntheir block size (32 for q4_0/q5_1/q8_0/mxfp4, 256 for q4_k/q5_k/q6_k).\n`error.InputTooSmall` when the row would overrun `raw_data`, `error.UnsupportedShape` on bad\nalignment, or `error.UnsupportedTensorType` for formats not handled here."
              },
              "members": []
            },
            {
              "name": "dotRow",
              "qualified_name": "dotRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotRow( raw_data: []const u8, row_index: u32, cols: u32, tensor_type: GGMLType, input: []const f32, scratch: []f32, ) !f32",
              "anchor": "dot-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 301,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L301",
              "doc": {
                "summary": "Dot one quantized row against an f32 input vector, dispatching on tensor type.",
                "description": [
                  "Hot formats (`f32`, `f16`, `bf16`, `q4_0`, `q8_0`, `q4_k`, `q5_k`, `q6_k`) take a fused vectorized path that streams weights and folds the dequant scales into the FMAs. Every other format falls back to dequantizing into `scratch` first and then dotting."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw tensor bytes for the full matrix."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns per row; subject to the same block-alignment constraints as `row`."
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization tag selecting the decode path."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  },
                  {
                    "name": "scratch",
                    "description": "Caller-owned scratch of length `>= cols`; only consumed on the fallback path."
                  }
                ],
                "returns": "The f32 dot product, or an error matching `row`'s shape and size diagnostics.",
                "notes": [],
                "raw": "Dot one quantized row against an f32 input vector, dispatching on tensor type.\nHot formats (`f32`, `f16`, `bf16`, `q4_0`, `q8_0`, `q4_k`, `q5_k`, `q6_k`) take a fused vectorized\npath that streams weights and folds the dequant scales into the FMAs. Every other format falls\nback to dequantizing into `scratch` first and then dotting."
              },
              "members": []
            },
            {
              "name": "dotF32Row",
              "qualified_name": "dotF32Row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotF32Row(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-f32-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-f32-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 337,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L337",
              "doc": {
                "summary": "Dot one f32-packed row against `input` using a 16-wide AVX-512-friendly inner loop.",
                "description": [
                  "Uses four independent accumulators driven by a 4-way unroll so the FP-add chain stays short."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw f32 row-major tensor bytes."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of f32 columns in the row."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.InputTooSmall` when `input` or `raw_data` is shorter than expected.",
                "notes": [],
                "raw": "Dot one f32-packed row against `input` using a 16-wide AVX-512-friendly inner loop.\nUses four independent accumulators driven by a 4-way unroll so the FP-add chain stays short."
              },
              "members": []
            },
            {
              "name": "dotF16Row",
              "qualified_name": "dotF16Row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotF16Row(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-f16-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-f16-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 400,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L400",
              "doc": {
                "summary": "Dot one f16-packed row against an f32 input vector, promoting each weight to f32 on the fly.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw f16 row-major tensor bytes."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of f16 columns in the row."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.InputTooSmall` when the input or row bytes are too short.",
                "notes": [],
                "raw": "Dot one f16-packed row against an f32 input vector, promoting each weight to f32 on the fly."
              },
              "members": []
            },
            {
              "name": "dotBf16Row",
              "qualified_name": "dotBf16Row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotBf16Row(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-bf16-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-bf16-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 422,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L422",
              "doc": {
                "summary": "Dot one bf16-packed row against an f32 input vector by zero-extending each weight into f32.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw bf16 row-major tensor bytes."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of bf16 columns in the row."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.InputTooSmall` when the input or row bytes are too short.",
                "notes": [],
                "raw": "Dot one bf16-packed row against an f32 input vector by zero-extending each weight into f32."
              },
              "members": []
            },
            {
              "name": "dotQ8_0Row",
              "qualified_name": "dotQ8_0Row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotQ8_0Row(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-q8-0-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-q8-0-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 446,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L446",
              "doc": {
                "summary": "Dot one Q8_0-packed row against an f32 input vector.",
                "description": [
                  "Q8_0 stores 32 signed-int8 weights per block with one f16 scale; this entry point validates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw Q8_0 tensor bytes (34 bytes per 32-element block)."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns; must be a multiple of 32."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.UnsupportedShape` / `error.InputTooSmall` on misuse.",
                "notes": [],
                "raw": "Dot one Q8_0-packed row against an f32 input vector.\nQ8_0 stores 32 signed-int8 weights per block with one f16 scale; this entry point validates\nblock alignment and bounds, then delegates to the unchecked vectorized inner loop."
              },
              "members": []
            },
            {
              "name": "dotQ4_0Row",
              "qualified_name": "dotQ4_0Row",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotQ4_0Row(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-q4-0-row",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-q4-0-row",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 526,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L526",
              "doc": {
                "summary": "Dot one Q4_0-packed row against an f32 input vector.",
                "description": [
                  "Q4_0 stores 32 nibble weights with a `-8` bias per block plus an f16 scale; this entry point validates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw Q4_0 tensor bytes (18 bytes per 32-element block)."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns; must be a multiple of 32."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.UnsupportedShape` / `error.InputTooSmall` on misuse.",
                "notes": [],
                "raw": "Dot one Q4_0-packed row against an f32 input vector.\nQ4_0 stores 32 nibble weights with a `-8` bias per block plus an f16 scale; this entry point\nvalidates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
              },
              "members": []
            },
            {
              "name": "quantizeRowToQ4_0",
              "qualified_name": "quantizeRowToQ4_0",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn quantizeRowToQ4_0(src: []const f32, dst: []u8) void",
              "anchor": "quantize-row-to-q4-0",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#quantize-row-to-q4-0",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 878,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L878",
              "doc": {
                "summary": "Quantize one row of f32 weights into the GGML `Q4_0` block layout.",
                "description": [
                  "Each 32-element block is stored as one f16 scale followed by 16 packed nibble pairs (low nibble = first weight, high nibble = second weight), where each nibble encodes a value in [0, 15] representing the original weight offset by +8. Mirrors the reference implementation's `quantize_row_q4_0_ref`."
                ],
                "params": [
                  {
                    "name": "src",
                    "description": "Source f32 values; length must be a positive multiple of 32."
                  },
                  {
                    "name": "dst",
                    "description": "Destination byte buffer; must be at least `(src.len / 32) * 18` bytes."
                  }
                ],
                "returns": null,
                "notes": [
                  "Asserts (debug builds only) that alignment and size preconditions hold."
                ],
                "raw": "Quantize one row of f32 weights into the GGML `Q4_0` block layout.\nEach 32-element block is stored as one f16 scale followed by 16 packed nibble\npairs (low nibble = first weight, high nibble = second weight), where each nibble\nencodes a value in [0, 15] representing the original weight offset by +8.\nMirrors the reference implementation's `quantize_row_q4_0_ref`."
              },
              "members": []
            },
            {
              "name": "quantizeRowToQ8_0",
              "qualified_name": "quantizeRowToQ8_0",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn quantizeRowToQ8_0(src: []const f32, dst: []u8) void",
              "anchor": "quantize-row-to-q8-0",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#quantize-row-to-q8-0",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 917,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L917",
              "doc": {
                "summary": "Quantize one row of f32 weights into the GGML `Q8_0` block layout.",
                "description": [
                  "Each 32-element block is stored as one f16 scale followed by 32 signed int8 values clamped to [-127, 127]; the scale is `max(|w|) / 127`. Mirrors the reference implementation's `quantize_row_q8_0_ref`."
                ],
                "params": [
                  {
                    "name": "src",
                    "description": "Source f32 values; length must be a positive multiple of 32."
                  },
                  {
                    "name": "dst",
                    "description": "Destination byte buffer; must be at least `(src.len / 32) * 34` bytes."
                  }
                ],
                "returns": null,
                "notes": [
                  "Asserts (debug builds only) that alignment and size preconditions hold."
                ],
                "raw": "Quantize one row of f32 weights into the GGML `Q8_0` block layout.\nEach 32-element block is stored as one f16 scale followed by 32 signed int8\nvalues clamped to [-127, 127]; the scale is `max(|w|) / 127`.\nMirrors the reference implementation's `quantize_row_q8_0_ref`."
              },
              "members": []
            },
            {
              "name": "dotQ4KRow",
              "qualified_name": "dotQ4KRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotQ4KRow(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-q4-krow",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-q4-krow",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 952,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L952",
              "doc": {
                "summary": "Dot one Q4_K-packed row against an f32 input vector.",
                "description": [
                  "Q4_K stores 256 weights per super-block as 8 sub-blocks of 32 nibbles, each with its own 6-bit scale and min packed into a 12-byte header (plus block-level f16 `d`/`dmin`); validates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw Q4_K tensor bytes (144 bytes per 256-element super-block)."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns; must be a multiple of 256."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.UnsupportedShape` / `error.InputTooSmall` on misuse.",
                "notes": [],
                "raw": "Dot one Q4_K-packed row against an f32 input vector.\nQ4_K stores 256 weights per super-block as 8 sub-blocks of 32 nibbles, each with its own 6-bit\nscale and min packed into a 12-byte header (plus block-level f16 `d`/`dmin`); validates block\nalignment and bounds, then delegates to the unchecked vectorized inner loop."
              },
              "members": []
            },
            {
              "name": "fillInputSum32",
              "qualified_name": "fillInputSum32",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn fillInputSum32(input: []const f32, sums: []f32) void",
              "anchor": "fill-input-sum32",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#fill-input-sum32",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 1045,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L1045",
              "doc": {
                "summary": "Precompute per-32-element sums of an input vector for the `WithSum32` Q4_K/Q5_K dot paths.",
                "description": [
                  "Those paths fold the asymmetric min subtraction `-m * sum(x_block)` out of the inner loop, so the caller fills `sums[i] = sum(input[i*32 .. (i+1)*32])` once and reuses it across many rows."
                ],
                "params": [
                  {
                    "name": "input",
                    "description": "Input vector whose length must be a positive multiple of 32."
                  },
                  {
                    "name": "sums",
                    "description": "Destination of length `>= input.len / 32`; lane `i` receives the sum of input block `i`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Precompute per-32-element sums of an input vector for the `WithSum32` Q4_K/Q5_K dot paths.\nThose paths fold the asymmetric min subtraction `-m * sum(x_block)` out of the inner loop, so the\ncaller fills `sums[i] = sum(input[i*32 .. (i+1)*32])` once and reuses it across many rows."
              },
              "members": []
            },
            {
              "name": "dotQ5KRow",
              "qualified_name": "dotQ5KRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotQ5KRow(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-q5-krow",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-q5-krow",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 1148,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L1148",
              "doc": {
                "summary": "Dot one Q5_K-packed row against an f32 input vector.",
                "description": [
                  "Q5_K extends Q4_K with a 5th high-bit plane stored as 32 bytes (one bit per weight, eight 32-element sub-blocks); validates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw Q5_K tensor bytes (176 bytes per 256-element super-block)."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns; must be a multiple of 256."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.UnsupportedShape` / `error.InputTooSmall` on misuse.",
                "notes": [],
                "raw": "Dot one Q5_K-packed row against an f32 input vector.\nQ5_K extends Q4_K with a 5th high-bit plane stored as 32 bytes (one bit per weight, eight 32-element\nsub-blocks); validates block alignment and bounds, then delegates to the unchecked vectorized\ninner loop."
              },
              "members": []
            },
            {
              "name": "dotQ6KRow",
              "qualified_name": "dotQ6KRow",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn dotQ6KRow(raw_data: []const u8, row_index: u32, cols: u32, input: []const f32) !f32",
              "anchor": "dot-q6-krow",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dequant/#dot-q6-krow",
              "source_path": "src/zinc_rt/isa/cpu_zig/dequant.zig",
              "source_line": 1329,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/dequant.zig#L1329",
              "doc": {
                "summary": "Dot one Q6_K-packed row against an f32 input vector.",
                "description": [
                  "Q6_K packs 256 6-bit weights as a low-nibble plane plus a 2-bit-per-weight high plane, with one f16 super-block scale and eight signed-int8 per-32 sub-scales; weights are recentered by `-32`. Validates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
                ],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw Q6_K tensor bytes (210 bytes per 256-element super-block)."
                  },
                  {
                    "name": "row_index",
                    "description": "Zero-based row to dot."
                  },
                  {
                    "name": "cols",
                    "description": "Number of columns; must be a multiple of 256."
                  },
                  {
                    "name": "input",
                    "description": "f32 input vector of length `>= cols`."
                  }
                ],
                "returns": "The f32 dot product, or `error.UnsupportedShape` / `error.InputTooSmall` on misuse.",
                "notes": [],
                "raw": "Dot one Q6_K-packed row against an f32 input vector.\nQ6_K packs 256 6-bit weights as a low-nibble plane plus a 2-bit-per-weight high plane, with one\nf16 super-block scale and eight signed-int8 per-32 sub-scales; weights are recentered by `-32`.\nValidates block alignment and bounds, then delegates to the unchecked vectorized inner loop."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "embed",
          "title": "Embed",
          "section": "Inference Runtime",
          "summary": "T-CPU EMBED implementation.",
          "overview": [
            "Reads one token row from a GGUF tensor into f32 hidden state."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/embed/",
          "source_path": "src/zinc_rt/isa/cpu_zig/embed.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/embed.zig#L14",
          "counts": {
            "code_lines": 32,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/embed/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/embed.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/embed.zig#L14",
              "doc": {
                "summary": "Inputs and outputs for one EMBED call.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the embedding matrix `[vocab_size, hidden_dim]`."
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization format of `raw_data` (forwarded to `dequant.row`)."
                  },
                  {
                    "name": "token_id",
                    "description": "Row index to fetch; must be `< vocab_size`."
                  },
                  {
                    "name": "hidden_dim",
                    "description": "Number of columns per row; also the required length of `output`."
                  },
                  {
                    "name": "vocab_size",
                    "description": "Number of embedding rows in `raw_data`."
                  },
                  {
                    "name": "output",
                    "description": "Destination hidden-state slice of length exactly `hidden_dim`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one EMBED call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/embed/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/embed.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/embed.zig#L28",
              "doc": {
                "summary": "Dequantize the row at `params.token_id` of the embedding matrix into `params.output`.",
                "description": [
                  "Thin wrapper over `dequant.row` that validates the token index and output shape. the output slice does not match `hidden_dim`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Token id, matrix shape, and destination slice; see `Params`."
                  }
                ],
                "returns": "`error.TokenOutOfRange` when the token id is past `vocab_size`, `error.ShapeMismatch` when",
                "notes": [],
                "raw": "Dequantize the row at `params.token_id` of the embedding matrix into `params.output`.\nThin wrapper over `dequant.row` that validates the token index and output shape.\nthe output slice does not match `hidden_dim`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "flash-attn",
          "title": "Flash Attn",
          "section": "Inference Runtime",
          "summary": "T-CPU flash attention (single-query decode) implementation.",
          "overview": [
            "Computes scaled dot-product attention over a KV cache for one query token."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/flash-attn/",
          "source_path": "src/zinc_rt/isa/cpu_zig/flash_attn.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/flash_attn.zig#L18",
          "counts": {
            "code_lines": 89,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/flash-attn/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/flash_attn.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/flash_attn.zig#L18",
              "doc": {
                "summary": "Inputs and outputs for one single-query flash attention call.",
                "description": [],
                "params": [
                  {
                    "name": "q",
                    "description": "Query vector packed `[n_heads, head_dim]` for the current decode token."
                  },
                  {
                    "name": "kv_k",
                    "description": "Key cache packed `[seq_len, n_kv_heads, head_dim]`."
                  },
                  {
                    "name": "kv_v",
                    "description": "Value cache packed `[seq_len, n_kv_heads, head_dim]`."
                  },
                  {
                    "name": "output",
                    "description": "Attention output packed `[n_heads, head_dim]`."
                  },
                  {
                    "name": "n_heads",
                    "description": "Number of query heads."
                  },
                  {
                    "name": "n_kv_heads",
                    "description": "Number of key/value heads (GQA: `n_heads / n_kv_heads` queries share each KV head)."
                  },
                  {
                    "name": "head_dim",
                    "description": "Per-head feature dimension."
                  },
                  {
                    "name": "seq_len",
                    "description": "Number of cached key/value positions to attend over."
                  },
                  {
                    "name": "attn_sinks",
                    "description": "Per-head sink logits added to the softmax denominator; NaN disables a head's sink."
                  },
                  {
                    "name": "scratch_scores",
                    "description": "Caller-owned scratch of length `>= seq_len` for raw scores."
                  },
                  {
                    "name": "scratch_probs",
                    "description": "Caller-owned scratch of length `>= seq_len` for exponentiated weights."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one single-query flash attention call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/flash-attn/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/flash_attn.zig",
              "source_line": 39,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/flash_attn.zig#L39",
              "doc": {
                "summary": "Compute single-query scaled dot-product attention with optional per-head softmax sinks.",
                "description": [
                  "For each query head: dots `q` against the cached keys, applies a `1/sqrt(head_dim)` scale, max-subtracted softmax (folding in the sink if finite), then writes the value-weighted sum to the matching slot of `output`. GQA is supported via `q_per_kv = n_heads / n_kv_heads`. slots are smaller than `seq_len` or `head_dim` is zero, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Query, KV cache, attention sinks, scratch buffers, and output slice; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when query or output is empty, `error.ShapeMismatch` when scratch",
                "notes": [],
                "raw": "Compute single-query scaled dot-product attention with optional per-head softmax sinks.\nFor each query head: dots `q` against the cached keys, applies a `1/sqrt(head_dim)` scale,\nmax-subtracted softmax (folding in the sink if finite), then writes the value-weighted sum\nto the matching slot of `output`. GQA is supported via `q_per_kv = n_heads / n_kv_heads`.\nslots are smaller than `seq_len` or `head_dim` is zero, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "lm-head",
          "title": "Lm Head",
          "section": "Inference Runtime",
          "summary": "T-CPU LM_HEAD implementation.",
          "overview": [
            "Projects hidden state through a GGUF output matrix and writes logits."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/lm-head/",
          "source_path": "src/zinc_rt/isa/cpu_zig/lm_head.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/lm_head.zig#L14",
          "counts": {
            "code_lines": 43,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lm-head/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/lm_head.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/lm_head.zig#L14",
              "doc": {
                "summary": "Inputs and outputs for one LM_HEAD call.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the output matrix `[vocab_size, hidden_dim]`."
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization format of `raw_data` (forwarded to `dequant.row`)."
                  },
                  {
                    "name": "hidden",
                    "description": "Final hidden state of length `hidden_dim`."
                  },
                  {
                    "name": "row_scratch",
                    "description": "Caller-owned scratch buffer of length exactly `hidden_dim` for one dequantized row."
                  },
                  {
                    "name": "logits",
                    "description": "Destination vector of length `vocab_size`; row `i` of the matrix maps to `logits[i]`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one LM_HEAD call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lm-head/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/lm_head.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/lm_head.zig#L27",
              "doc": {
                "summary": "Project the hidden state through every row of the GGUF output matrix to produce vocab logits.",
                "description": [
                  "Rows are dequantized one at a time into `row_scratch` and dot-multiplied with `hidden`. `row_scratch` is not exactly `hidden.len`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Tensor data, hidden state, scratch row, and logits slice; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when either `hidden` or `logits` is empty, `error.ShapeMismatch` when",
                "notes": [],
                "raw": "Project the hidden state through every row of the GGUF output matrix to produce vocab logits.\nRows are dequantized one at a time into `row_scratch` and dot-multiplied with `hidden`.\n`row_scratch` is not exactly `hidden.len`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "matvec",
          "title": "Matvec",
          "section": "Inference Runtime",
          "summary": "T-CPU matrix-vector projection implementation.",
          "overview": [
            "Dequantizes one GGUF tensor row at a time and computes a scalar matvec."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/matvec/",
          "source_path": "src/zinc_rt/isa/cpu_zig/matvec.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/matvec.zig#L15",
          "counts": {
            "code_lines": 68,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/matvec/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/matvec.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/matvec.zig#L15",
              "doc": {
                "summary": "Inputs and outputs for one matrix-vector projection.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the weight matrix `[rows, cols]`."
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization format of `raw_data` (forwarded to `dequant.row`)."
                  },
                  {
                    "name": "input",
                    "description": "Input vector of length `cols`."
                  },
                  {
                    "name": "row_scratch",
                    "description": "Caller-owned scratch of length `>= cols` used to materialize one dequantized row."
                  },
                  {
                    "name": "output",
                    "description": "Destination vector of length `rows`; row `i` of the matrix lands in `output[i]`."
                  },
                  {
                    "name": "accumulate",
                    "description": "When true, add into `output` instead of overwriting (e.g. for MoE expert mixing)."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one matrix-vector projection."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/matvec/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/matvec.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/matvec.zig#L29",
              "doc": {
                "summary": "Compute `output = W * input` (or `output += W * input` when `accumulate` is set) one row at a time.",
                "description": [
                  "Each row of the GGUF matrix is dequantized into `row_scratch` and dotted against `input`. `row_scratch` is shorter than `input`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Tensor data, input vector, scratch row, and output slice; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when input or output is empty, `error.ShapeMismatch` when",
                "notes": [],
                "raw": "Compute `output = W * input` (or `output += W * input` when `accumulate` is set) one row at a time.\nEach row of the GGUF matrix is dequantized into `row_scratch` and dotted against `input`.\n`row_scratch` is shorter than `input`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "mod",
          "title": "Mod",
          "section": "Inference Runtime",
          "summary": "Pure Zig T-CPU opcode implementations.",
          "overview": [
            "The modules exported here are clarity-first reference kernels used by the CPU ring and by future cross-tier validation tests."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/",
          "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L7",
          "counts": {
            "code_lines": 6,
            "exports": 6,
            "methods": 0,
            "symbols": 6
          },
          "symbols": [
            {
              "name": "rms_norm",
              "qualified_name": "rms_norm",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const rms_norm = @import(\"rms_norm.zig\")",
              "anchor": "rms-norm",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#rms-norm",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 7,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L7",
              "doc": {
                "summary": "Scalar RMS normalization with learned per-channel weight, used as the CPU oracle for layer norm.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Scalar RMS normalization with learned per-channel weight, used as the CPU oracle for layer norm."
              },
              "members": []
            },
            {
              "name": "swiglu",
              "qualified_name": "swiglu",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const swiglu = @import(\"swiglu.zig\")",
              "anchor": "swiglu",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#swiglu",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 9,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L9",
              "doc": {
                "summary": "Scalar SwiGLU activation (`silu(gate) * up`) used by dense and MoE MLP paths.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Scalar SwiGLU activation (`silu(gate) * up`) used by dense and MoE MLP paths."
              },
              "members": []
            },
            {
              "name": "argmax",
              "qualified_name": "argmax",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const argmax = @import(\"argmax.zig\")",
              "anchor": "argmax",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#argmax",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L11",
              "doc": {
                "summary": "Deterministic argmax over a logits vector; picks the lowest index on ties.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Deterministic argmax over a logits vector; picks the lowest index on ties."
              },
              "members": []
            },
            {
              "name": "dequant",
              "qualified_name": "dequant",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const dequant = @import(\"dequant.zig\")",
              "anchor": "dequant",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#dequant",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L13",
              "doc": {
                "summary": "Shared GGML row dequantization and quantized row dot-product helpers consumed by other CPU ops.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Shared GGML row dequantization and quantized row dot-product helpers consumed by other CPU ops."
              },
              "members": []
            },
            {
              "name": "embed",
              "qualified_name": "embed",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const embed = @import(\"embed.zig\")",
              "anchor": "embed",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#embed",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L15",
              "doc": {
                "summary": "Token embedding lookup: dequantize one row of a GGUF embedding matrix into f32 hidden state.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Token embedding lookup: dequantize one row of a GGUF embedding matrix into f32 hidden state."
              },
              "members": []
            },
            {
              "name": "lm_head",
              "qualified_name": "lm_head",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const lm_head = @import(\"lm_head.zig\")",
              "anchor": "lm-head",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#lm-head",
              "source_path": "src/zinc_rt/isa/cpu_zig/mod.zig",
              "source_line": 17,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/mod.zig#L17",
              "doc": {
                "summary": "LM head projection: multiply a GGUF output matrix by the final hidden state to produce vocab logits.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "LM head projection: multiply a GGUF output matrix by the final hidden state to produce vocab logits."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "moe-gate-topk",
          "title": "Moe Gate Topk",
          "section": "Inference Runtime",
          "summary": "T-CPU MOE_GATE_TOPK implementation.",
          "overview": [
            "Computes router logits from a GGUF gate matrix, then selects and normalizes the active expert weights using the same routing rules as the Vulkan path."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/moe-gate-topk/",
          "source_path": "src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig#L12",
          "counts": {
            "code_lines": 168,
            "exports": 3,
            "methods": 0,
            "symbols": 3
          },
          "symbols": [
            {
              "name": "RoutingRule",
              "qualified_name": "RoutingRule",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const RoutingRule = enum",
              "anchor": "routing-rule",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/moe-gate-topk/#routing-rule",
              "source_path": "src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig#L12",
              "doc": {
                "summary": "Selection rule applied after the router projection to convert logits into expert weights.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Selection rule applied after the router projection to convert logits into expert weights."
              },
              "members": []
            },
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/moe-gate-topk/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig",
              "source_line": 30,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig#L30",
              "doc": {
                "summary": "Inputs and outputs for one MoE gate + top-k call.",
                "description": [],
                "params": [
                  {
                    "name": "raw_data",
                    "description": "Raw GGUF tensor bytes for the router matrix `[num_experts, hidden_dim]`."
                  },
                  {
                    "name": "tensor_type",
                    "description": "GGML quantization format of `raw_data` (forwarded to `dequant.row`)."
                  },
                  {
                    "name": "hidden",
                    "description": "Hidden state of length `hidden_dim`."
                  },
                  {
                    "name": "row_scratch",
                    "description": "Caller-owned scratch of length `>= hidden_dim` for one dequantized router row."
                  },
                  {
                    "name": "logits",
                    "description": "Destination router logits of length `num_experts`; capped at 256 experts."
                  },
                  {
                    "name": "k",
                    "description": "Number of experts to select; must satisfy `1 <= k <= logits.len`."
                  },
                  {
                    "name": "output_ids",
                    "description": "Destination expert indices of length `>= k`."
                  },
                  {
                    "name": "output_weights",
                    "description": "Destination per-expert weights of length `>= k`, summing to 1 after the call."
                  },
                  {
                    "name": "rule",
                    "description": "Routing rule that decides how the top-k weights are computed (see `RoutingRule`)."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one MoE gate + top-k call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/moe-gate-topk/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/moe_gate_topk.zig#L50",
              "doc": {
                "summary": "Project the hidden state through the router matrix, then select and normalize the top-k experts.",
                "description": [
                  "First fills `logits` row by row (matvec via `dequant.row`), then dispatches on `rule` to either `softmax_all` (softmax across all experts, pick top-k, renormalize) or `softmax_selected` (pick top-k by raw logit, softmax across that subset). `error.InvalidTopK` when `k` is zero or larger than the expert count, `error.ShapeMismatch` when scratch or output slices are too small, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Router weights, hidden state, scratch buffers, selection size, and outputs; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` for empty inputs, `error.TooManyExperts` when `logits.len > 256`,",
                "notes": [],
                "raw": "Project the hidden state through the router matrix, then select and normalize the top-k experts.\nFirst fills `logits` row by row (matvec via `dequant.row`), then dispatches on `rule` to either\n`softmax_all` (softmax across all experts, pick top-k, renormalize) or `softmax_selected`\n(pick top-k by raw logit, softmax across that subset).\n`error.InvalidTopK` when `k` is zero or larger than the expert count, `error.ShapeMismatch` when\nscratch or output slices are too small, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "residual-rms-norm",
          "title": "Residual Rms Norm",
          "section": "Inference Runtime",
          "summary": "T-CPU residual add + RMS norm implementation.",
          "overview": [
            "Computes: output = weight * rms_norm(x + residual)"
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/residual-rms-norm/",
          "source_path": "src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig#L12",
          "counts": {
            "code_lines": 59,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/residual-rms-norm/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig#L12",
              "doc": {
                "summary": "Inputs and outputs for one fused residual-add + RMS-norm call.",
                "description": [],
                "params": [
                  {
                    "name": "x",
                    "description": "Hidden state to normalize after residual addition."
                  },
                  {
                    "name": "residual",
                    "description": "Residual contribution added element-wise to `x` before normalization."
                  },
                  {
                    "name": "weight",
                    "description": "Per-channel learned scale applied after RMS normalization."
                  },
                  {
                    "name": "output",
                    "description": "Destination hidden state of length `>= x.len`."
                  },
                  {
                    "name": "eps",
                    "description": "Small constant added inside the square root to keep division numerically stable."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one fused residual-add + RMS-norm call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/residual-rms-norm/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/residual_rms_norm.zig#L26",
              "doc": {
                "summary": "Compute `output = weight * (x + residual) / sqrt(mean((x + residual)^2) + eps)`.",
                "description": [
                  "Fuses the post-attention/post-MLP residual add with the RMS norm so the sum lives only in registers; matches the GPU kernel that the Vulkan path uses on the decode hot loop. companion slice is shorter than `x`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Inputs, residual, learned scale, output slice, and `eps`; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when inputs are zero-length, `error.ShapeMismatch` when any",
                "notes": [],
                "raw": "Compute `output = weight * (x + residual) / sqrt(mean((x + residual)^2) + eps)`.\nFuses the post-attention/post-MLP residual add with the RMS norm so the sum lives only in\nregisters; matches the GPU kernel that the Vulkan path uses on the decode hot loop.\ncompanion slice is shorter than `x`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "rms-norm",
          "title": "Rms Norm",
          "section": "Inference Runtime",
          "summary": "T-CPU RMS_NORM implementation.",
          "overview": [
            "This is the scalar reference for RMS normalization and intentionally favors exactness and readable shape checks over throughput."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/rms-norm/",
          "source_path": "src/zinc_rt/isa/cpu_zig/rms_norm.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rms_norm.zig#L12",
          "counts": {
            "code_lines": 35,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/rms-norm/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/rms_norm.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rms_norm.zig#L12",
              "doc": {
                "summary": "Inputs and outputs for one RMS_NORM call.",
                "description": [],
                "params": [
                  {
                    "name": "input",
                    "description": "Vector to normalize."
                  },
                  {
                    "name": "weight",
                    "description": "Per-channel learned scale; must match `input` in length."
                  },
                  {
                    "name": "output",
                    "description": "Destination vector; must match `input` in length."
                  },
                  {
                    "name": "eps",
                    "description": "Small constant added inside the square root to keep division numerically stable."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one RMS_NORM call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/rms-norm/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/rms_norm.zig",
              "source_line": 24,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rms_norm.zig#L24",
              "doc": {
                "summary": "Compute `output[i] = weight[i] * input[i] / sqrt(mean(input^2) + eps)`.",
                "description": [
                  "Scalar reference implementation; favors readable shape checks and bit-stable math over throughput. `output` do not exactly match `input.len`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Input, learned scale, output slice, and `eps`; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when `input` is zero-length, `error.ShapeMismatch` when `weight` or",
                "notes": [],
                "raw": "Compute `output[i] = weight[i] * input[i] / sqrt(mean(input^2) + eps)`.\nScalar reference implementation; favors readable shape checks and bit-stable math over throughput.\n`output` do not exactly match `input.len`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "rope",
          "title": "Rope",
          "section": "Inference Runtime",
          "summary": "T-CPU RoPE (Rotary Positional Embedding) implementation.",
          "overview": [
            "Applies in-place rotary embeddings to query or key head data."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/rope/",
          "source_path": "src/zinc_rt/isa/cpu_zig/rope.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rope.zig#L13",
          "counts": {
            "code_lines": 59,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/rope/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/rope.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rope.zig#L13",
              "doc": {
                "summary": "Inputs for one in-place RoPE pass over a Q or K tensor.",
                "description": [],
                "params": [
                  {
                    "name": "data",
                    "description": "Mutable head-major buffer; head `h` lives at `data[h * stride ..][0..rope_dim]`."
                  },
                  {
                    "name": "stride",
                    "description": "Distance in floats between successive heads in `data`."
                  },
                  {
                    "name": "rope_dim",
                    "description": "Number of contiguous dimensions per head touched by RoPE (must be even)."
                  },
                  {
                    "name": "n_heads",
                    "description": "Number of heads to rotate."
                  },
                  {
                    "name": "position",
                    "description": "Absolute token position used to compute the rotation angle."
                  },
                  {
                    "name": "inv_freq",
                    "description": "Inverse frequencies of length `rope_dim / 2`; missing entries default to zero (no rotation)."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs for one in-place RoPE pass over a Q or K tensor."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/rope/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/rope.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/rope.zig#L28",
              "doc": {
                "summary": "Apply rotary positional embeddings in place to every head in `params.data`.",
                "description": [
                  "For each head and each frequency pair `(a, b) = (data[i], data[i + rope_dim/2])`, rotates by `theta = position * inv_freq[i]`: writes `(a*cos - b*sin, a*sin + b*cos)`. Uses the half-rotation layout (NeoX-style), matching the Vulkan kernels."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Buffer, stride, rope dim, head count, position, and `inv_freq` table; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when `data` is zero-length, otherwise void.",
                "notes": [],
                "raw": "Apply rotary positional embeddings in place to every head in `params.data`.\nFor each head and each frequency pair `(a, b) = (data[i], data[i + rope_dim/2])`, rotates by\n`theta = position * inv_freq[i]`: writes `(a*cos - b*sin, a*sin + b*cos)`. Uses the half-rotation\nlayout (NeoX-style), matching the Vulkan kernels."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "sigmoid-mul",
          "title": "Sigmoid Mul",
          "section": "Inference Runtime",
          "summary": "T-CPU sigmoid-gated multiply implementation.",
          "overview": [
            "Computes: output[i] = sigmoid(gate[i]) * x[i] Used for attention gating (Q-gate) and SSM gated norm."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/sigmoid-mul/",
          "source_path": "src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig#L11",
          "counts": {
            "code_lines": 30,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/sigmoid-mul/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig#L11",
              "doc": {
                "summary": "Inputs and outputs for one sigmoid-gated multiply.",
                "description": [],
                "params": [
                  {
                    "name": "gate",
                    "description": "Pre-activation gate values; sigmoid is applied element-wise."
                  },
                  {
                    "name": "x",
                    "description": "Companion values multiplied by the sigmoid of `gate`."
                  },
                  {
                    "name": "output",
                    "description": "Destination vector of length `>= gate.len`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one sigmoid-gated multiply."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/sigmoid-mul/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig",
              "source_line": 23,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/sigmoid_mul.zig#L23",
              "doc": {
                "summary": "Compute `output[i] = sigmoid(gate[i]) * x[i]` for every gate element.",
                "description": [
                  "Used by attention Q-gating and SSM gated-norm paths where a learned scalar selects how much of `x` to pass through. is shorter than `gate`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Gate, value, and output slices; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when `gate` is empty, `error.ShapeMismatch` when `output` or `x`",
                "notes": [],
                "raw": "Compute `output[i] = sigmoid(gate[i]) * x[i]` for every gate element.\nUsed by attention Q-gating and SSM gated-norm paths where a learned scalar selects how much of\n`x` to pass through.\nis shorter than `gate`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "swiglu",
          "title": "Swiglu",
          "section": "Inference Runtime",
          "summary": "T-CPU SwiGLU implementation.",
          "overview": [
            "This is the scalar reference activation used by MoE and dense MLP paths before tier-specific kernels are trusted."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/swiglu/",
          "source_path": "src/zinc_rt/isa/cpu_zig/swiglu.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/swiglu.zig#L11",
          "counts": {
            "code_lines": 23,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/swiglu/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/swiglu.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/swiglu.zig#L11",
              "doc": {
                "summary": "Inputs and outputs for one SwiGLU activation.",
                "description": [],
                "params": [
                  {
                    "name": "gate",
                    "description": "Gate-projection vector fed through SiLU."
                  },
                  {
                    "name": "up",
                    "description": "Up-projection vector multiplied by the SiLU-gated values."
                  },
                  {
                    "name": "output",
                    "description": "Destination vector; all three slices must be the same length."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one SwiGLU activation."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/swiglu/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/swiglu.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/swiglu.zig#L21",
              "doc": {
                "summary": "Compute `output[i] = silu(gate[i]) * up[i]` where `silu(x) = x / (1 + exp(-x))`.",
                "description": [
                  "Reference SwiGLU used by MoE and dense MLP paths to validate tier-specific kernels."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Gate, up, and output slices of equal length; see `Params`."
                  }
                ],
                "returns": "`error.ShapeMismatch` when the three slices differ in length, otherwise void.",
                "notes": [],
                "raw": "Compute `output[i] = silu(gate[i]) * up[i]` where `silu(x) = x / (1 + exp(-x))`.\nReference SwiGLU used by MoE and dense MLP paths to validate tier-specific kernels."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "vadd",
          "title": "Vadd",
          "section": "Inference Runtime",
          "summary": "T-CPU element-wise vector addition implementation.",
          "overview": [
            "Computes: output[i] = a[i] + b[i]"
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/vadd/",
          "source_path": "src/zinc_rt/isa/cpu_zig/vadd.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/vadd.zig#L10",
          "counts": {
            "code_lines": 27,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/vadd/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/vadd.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/vadd.zig#L10",
              "doc": {
                "summary": "Inputs and outputs for one element-wise vector addition.",
                "description": [],
                "params": [
                  {
                    "name": "a",
                    "description": "First operand vector."
                  },
                  {
                    "name": "b",
                    "description": "Second operand vector of length `>= a.len`."
                  },
                  {
                    "name": "output",
                    "description": "Destination vector of length `>= a.len`."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one element-wise vector addition."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/vadd/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/vadd.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/vadd.zig#L21",
              "doc": {
                "summary": "Compute `output[i] = a[i] + b[i]` for the first `a.len` elements.",
                "description": [
                  "Trailing elements of `b` and `output` are ignored, so callers may pass over-sized buffers. is shorter than `a`, otherwise void."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Operand and destination slices; see `Params`."
                  }
                ],
                "returns": "`error.EmptyInput` when `a` is empty, `error.ShapeMismatch` when `output` or `b`",
                "notes": [],
                "raw": "Compute `output[i] = a[i] + b[i]` for the first `a.len` elements.\nTrailing elements of `b` and `output` are ignored, so callers may pass over-sized buffers.\nis shorter than `a`, otherwise void."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "kmd",
          "title": "Kmd",
          "section": "Inference Runtime",
          "summary": "Thin AMDGPU kernel-driver queries used by direct ZINC_RT tiers.",
          "overview": [
            "This file intentionally starts with capability discovery only. T2 UMQ queue creation needs the same UAPI definitions, but selection must first prove the kernel exposes compute user queues instead of relying on kernel version alone."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/",
          "source_path": "src/zinc_rt/kmd.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L15",
          "counts": {
            "code_lines": 390,
            "exports": 43,
            "methods": 0,
            "symbols": 43
          },
          "symbols": [
            {
              "name": "QueryStatus",
              "qualified_name": "QueryStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const QueryStatus = enum",
              "anchor": "query-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#query-status",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L15",
              "doc": {
                "summary": "Outcome of probing the AMDGPU render node for compute user-queue support.",
                "description": [
                  "Each variant maps to a specific failure mode when discovering whether the kernel exposes the UMQ surface ZINC_RT tier 2 needs."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome of probing the AMDGPU render node for compute user-queue support.\nEach variant maps to a specific failure mode when discovering whether the\nkernel exposes the UMQ surface ZINC_RT tier 2 needs."
              },
              "members": []
            },
            {
              "name": "ComputeUserqInfo",
              "qualified_name": "ComputeUserqInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ComputeUserqInfo = struct",
              "anchor": "compute-userq-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#compute-userq-info",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L29",
              "doc": {
                "summary": "Compute user-queue capability metadata reported by the kernel.",
                "description": [
                  "Captures the slot count and the EOP (end-of-pipe) scratch buffer sizing the driver requires when creating a compute UMQ."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Compute user-queue capability metadata reported by the kernel.\nCaptures the slot count and the EOP (end-of-pipe) scratch buffer sizing the\ndriver requires when creating a compute UMQ."
              },
              "members": []
            },
            {
              "name": "QueryResult",
              "qualified_name": "QueryResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const QueryResult = struct",
              "anchor": "query-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#query-result",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L38",
              "doc": {
                "summary": "Combined result returned by `queryComputeUserq`.",
                "description": [
                  "Carries the discovery status plus optional capability info and the errno captured from the failing ioctl, when applicable."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Combined result returned by `queryComputeUserq`.\nCarries the discovery status plus optional capability info and the errno\ncaptured from the failing ioctl, when applicable."
              },
              "members": []
            },
            {
              "name": "AMDGPU_HW_IP_COMPUTE",
              "qualified_name": "AMDGPU_HW_IP_COMPUTE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_HW_IP_COMPUTE: u32 = 1",
              "anchor": "amdgpu-hw-ip-compute",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-hw-ip-compute",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 48,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L48",
              "doc": {
                "summary": "AMDGPU HW IP type selector for the compute pipe used by `AMDGPU_INFO` queries.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "AMDGPU HW IP type selector for the compute pipe used by `AMDGPU_INFO` queries."
              },
              "members": []
            },
            {
              "name": "AMDGPU_INFO_HW_IP_INFO",
              "qualified_name": "AMDGPU_INFO_HW_IP_INFO",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_INFO_HW_IP_INFO: u32 = 0x02",
              "anchor": "amdgpu-info-hw-ip-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-info-hw-ip-info",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L50",
              "doc": {
                "summary": "`AMDGPU_INFO` sub-query that returns `DrmAmdgpuInfoHwIp` for a given HW IP.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDGPU_INFO` sub-query that returns `DrmAmdgpuInfoHwIp` for a given HW IP."
              },
              "members": []
            },
            {
              "name": "AMDGPU_INFO_UQ_FW_AREAS",
              "qualified_name": "AMDGPU_INFO_UQ_FW_AREAS",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_INFO_UQ_FW_AREAS: u32 = 0x24",
              "anchor": "amdgpu-info-uq-fw-areas",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-info-uq-fw-areas",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 52,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L52",
              "doc": {
                "summary": "`AMDGPU_INFO` sub-query that returns user-queue firmware area metadata (`DrmAmdgpuInfoUqMetadata`).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDGPU_INFO` sub-query that returns user-queue firmware area metadata (`DrmAmdgpuInfoUqMetadata`)."
              },
              "members": []
            },
            {
              "name": "AMDGPU_USERQ_OP_CREATE",
              "qualified_name": "AMDGPU_USERQ_OP_CREATE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_USERQ_OP_CREATE: u32 = 1",
              "anchor": "amdgpu-userq-op-create",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-userq-op-create",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 54,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L54",
              "doc": {
                "summary": "`DRM_AMDGPU_USERQ` op code that allocates a new user-mode queue.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_USERQ` op code that allocates a new user-mode queue."
              },
              "members": []
            },
            {
              "name": "AMDGPU_USERQ_OP_FREE",
              "qualified_name": "AMDGPU_USERQ_OP_FREE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_USERQ_OP_FREE: u32 = 2",
              "anchor": "amdgpu-userq-op-free",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-userq-op-free",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 56,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L56",
              "doc": {
                "summary": "`DRM_AMDGPU_USERQ` op code that releases a previously created user-mode queue.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_USERQ` op code that releases a previously created user-mode queue."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_DOMAIN_GTT",
              "qualified_name": "AMDGPU_GEM_DOMAIN_GTT",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_DOMAIN_GTT: u64 = 0x2",
              "anchor": "amdgpu-gem-domain-gtt",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-domain-gtt",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 59,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L59",
              "doc": {
                "summary": "GEM domain flag requesting allocation in system GTT memory.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM domain flag requesting allocation in system GTT memory."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_DOMAIN_VRAM",
              "qualified_name": "AMDGPU_GEM_DOMAIN_VRAM",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_DOMAIN_VRAM: u64 = 0x4",
              "anchor": "amdgpu-gem-domain-vram",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-domain-vram",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 61,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L61",
              "doc": {
                "summary": "GEM domain flag requesting allocation in device VRAM.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM domain flag requesting allocation in device VRAM."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_DOMAIN_DOORBELL",
              "qualified_name": "AMDGPU_GEM_DOMAIN_DOORBELL",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_DOMAIN_DOORBELL: u64 = 0x40",
              "anchor": "amdgpu-gem-domain-doorbell",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-domain-doorbell",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 63,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L63",
              "doc": {
                "summary": "GEM domain flag requesting allocation in the MMIO doorbell aperture.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM domain flag requesting allocation in the MMIO doorbell aperture."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_CREATE_CPU_GTT_USWC",
              "qualified_name": "AMDGPU_GEM_CREATE_CPU_GTT_USWC",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_CREATE_CPU_GTT_USWC: u64 = 1 << 2",
              "anchor": "amdgpu-gem-create-cpu-gtt-uswc",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-create-cpu-gtt-uswc",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 66,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L66",
              "doc": {
                "summary": "GEM creation flag asking the kernel to map GTT memory as CPU write-combined for fast streaming writes.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM creation flag asking the kernel to map GTT memory as CPU write-combined for fast streaming writes."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_CREATE_VRAM_CLEARED",
              "qualified_name": "AMDGPU_GEM_CREATE_VRAM_CLEARED",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_CREATE_VRAM_CLEARED: u64 = 1 << 3",
              "anchor": "amdgpu-gem-create-vram-cleared",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-create-vram-cleared",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 68,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L68",
              "doc": {
                "summary": "GEM creation flag asking the kernel to zero-fill VRAM allocations before returning the BO.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM creation flag asking the kernel to zero-fill VRAM allocations before returning the BO."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED",
              "qualified_name": "AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED: u64 = 1 << 0",
              "anchor": "amdgpu-gem-create-cpu-access-required",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-create-cpu-access-required",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 72,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L72",
              "doc": {
                "summary": "GEM creation flag requiring the VRAM allocation to land in the CPU-visible BAR aperture so the BO can be mmap'd and written by the host (needs large / resizable BAR for allocations beyond the legacy 256 MiB window).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM creation flag requiring the VRAM allocation to land in the CPU-visible\nBAR aperture so the BO can be mmap'd and written by the host (needs large /\nresizable BAR for allocations beyond the legacy 256 MiB window)."
              },
              "members": []
            },
            {
              "name": "AMDGPU_GEM_CREATE_VM_ALWAYS_VALID",
              "qualified_name": "AMDGPU_GEM_CREATE_VM_ALWAYS_VALID",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_GEM_CREATE_VM_ALWAYS_VALID: u64 = 1 << 6",
              "anchor": "amdgpu-gem-create-vm-always-valid",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-gem-create-vm-always-valid",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 74,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L74",
              "doc": {
                "summary": "GEM creation flag keeping the BO permanently mapped in the device VM so it never needs revalidation.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GEM creation flag keeping the BO permanently mapped in the device VM so it never needs revalidation."
              },
              "members": []
            },
            {
              "name": "AMDGPU_VA_OP_MAP",
              "qualified_name": "AMDGPU_VA_OP_MAP",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_VA_OP_MAP: u32 = 1",
              "anchor": "amdgpu-va-op-map",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-va-op-map",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 77,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L77",
              "doc": {
                "summary": "`DRM_AMDGPU_GEM_VA` operation that binds a BO into the device virtual address space.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_GEM_VA` operation that binds a BO into the device virtual address space."
              },
              "members": []
            },
            {
              "name": "AMDGPU_VM_PAGE_READABLE",
              "qualified_name": "AMDGPU_VM_PAGE_READABLE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_VM_PAGE_READABLE: u32 = 1 << 1",
              "anchor": "amdgpu-vm-page-readable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-vm-page-readable",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 79,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L79",
              "doc": {
                "summary": "VA mapping flag granting GPU read access to the mapped range.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VA mapping flag granting GPU read access to the mapped range."
              },
              "members": []
            },
            {
              "name": "AMDGPU_VM_PAGE_WRITEABLE",
              "qualified_name": "AMDGPU_VM_PAGE_WRITEABLE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_VM_PAGE_WRITEABLE: u32 = 1 << 2",
              "anchor": "amdgpu-vm-page-writeable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-vm-page-writeable",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 81,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L81",
              "doc": {
                "summary": "VA mapping flag granting GPU write access to the mapped range.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VA mapping flag granting GPU write access to the mapped range."
              },
              "members": []
            },
            {
              "name": "AMDGPU_VM_PAGE_EXECUTABLE",
              "qualified_name": "AMDGPU_VM_PAGE_EXECUTABLE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_VM_PAGE_EXECUTABLE: u32 = 1 << 3",
              "anchor": "amdgpu-vm-page-executable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-vm-page-executable",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 83,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L83",
              "doc": {
                "summary": "VA mapping flag granting GPU shader-execute access to the mapped range.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VA mapping flag granting GPU shader-execute access to the mapped range."
              },
              "members": []
            },
            {
              "name": "AMDGPU_VM_MTYPE_DEFAULT",
              "qualified_name": "AMDGPU_VM_MTYPE_DEFAULT",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_VM_MTYPE_DEFAULT: u32 = 0 << 5",
              "anchor": "amdgpu-vm-mtype-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#amdgpu-vm-mtype-default",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 85,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L85",
              "doc": {
                "summary": "VA mapping flag selecting the default memory type (MTYPE) for the GPU page table entry.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VA mapping flag selecting the default memory type (MTYPE) for the GPU page table entry."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemCreateIn",
              "qualified_name": "DrmAmdgpuGemCreateIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuGemCreateIn = extern struct",
              "anchor": "drm-amdgpu-gem-create-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-create-in",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 95,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L95",
              "doc": {
                "summary": "Input layout for the `DRM_IOCTL_AMDGPU_GEM_CREATE` ioctl.",
                "description": [
                  "Mirrors the kernel UAPI struct describing the requested buffer size, alignment, domain mask, and creation flags."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input layout for the `DRM_IOCTL_AMDGPU_GEM_CREATE` ioctl.\nMirrors the kernel UAPI struct describing the requested buffer size, alignment, domain mask, and creation flags."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemCreateOut",
              "qualified_name": "DrmAmdgpuGemCreateOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuGemCreateOut = extern struct",
              "anchor": "drm-amdgpu-gem-create-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-create-out",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 103,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L103",
              "doc": {
                "summary": "Output layout returned by `DRM_IOCTL_AMDGPU_GEM_CREATE`, holding the freshly allocated BO handle.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output layout returned by `DRM_IOCTL_AMDGPU_GEM_CREATE`, holding the freshly allocated BO handle."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemCreate",
              "qualified_name": "DrmAmdgpuGemCreate",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuGemCreate = extern union",
              "anchor": "drm-amdgpu-gem-create",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-create",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 109,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L109",
              "doc": {
                "summary": "Tagged union packing the in/out forms of the GEM-create ioctl into the same buffer the kernel reads and writes.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union packing the in/out forms of the GEM-create ioctl into the same buffer the kernel reads and writes."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemMmapIn",
              "qualified_name": "DrmAmdgpuGemMmapIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuGemMmapIn = extern struct",
              "anchor": "drm-amdgpu-gem-mmap-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-mmap-in",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 115,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L115",
              "doc": {
                "summary": "Input layout for `DRM_IOCTL_AMDGPU_GEM_MMAP`, identifying the BO to expose to userspace.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input layout for `DRM_IOCTL_AMDGPU_GEM_MMAP`, identifying the BO to expose to userspace."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemMmapOut",
              "qualified_name": "DrmAmdgpuGemMmapOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuGemMmapOut = extern struct",
              "anchor": "drm-amdgpu-gem-mmap-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-mmap-out",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 121,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L121",
              "doc": {
                "summary": "Output layout returned by `DRM_IOCTL_AMDGPU_GEM_MMAP` with the file offset to pass to `mmap`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output layout returned by `DRM_IOCTL_AMDGPU_GEM_MMAP` with the file offset to pass to `mmap`."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemMmap",
              "qualified_name": "DrmAmdgpuGemMmap",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuGemMmap = extern union",
              "anchor": "drm-amdgpu-gem-mmap",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-mmap",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 126,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L126",
              "doc": {
                "summary": "Tagged union packing the in/out forms of the GEM-mmap ioctl into one shared buffer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union packing the in/out forms of the GEM-mmap ioctl into one shared buffer."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuGemVa",
              "qualified_name": "DrmAmdgpuGemVa",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuGemVa = extern struct",
              "anchor": "drm-amdgpu-gem-va",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-gem-va",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 133,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L133",
              "doc": {
                "summary": "Argument layout for `DRM_IOCTL_AMDGPU_GEM_VA`, the ioctl that maps a BO into the GPU virtual address space.",
                "description": [
                  "Encodes the BO handle, VA operation, page-permission flags, target VA range, and any syncobj fence handles."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Argument layout for `DRM_IOCTL_AMDGPU_GEM_VA`, the ioctl that maps a BO into the GPU virtual address space.\nEncodes the BO handle, VA operation, page-permission flags, target VA range, and any syncobj fence handles."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuInfo",
              "qualified_name": "DrmAmdgpuInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuInfo = extern struct",
              "anchor": "drm-amdgpu-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-info",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 149,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L149",
              "doc": {
                "summary": "Argument layout for `DRM_IOCTL_AMDGPU_INFO`, the generic info-query ioctl.",
                "description": [
                  "`return_pointer`/`return_size` describe a userspace output buffer; `query` selects a sub-query whose discriminator-specific parameters live in `query_data`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Argument layout for `DRM_IOCTL_AMDGPU_INFO`, the generic info-query ioctl.\n`return_pointer`/`return_size` describe a userspace output buffer; `query` selects a sub-query whose discriminator-specific parameters live in `query_data`."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuInfoHwIp",
              "qualified_name": "DrmAmdgpuInfoHwIp",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuInfoHwIp = extern struct",
              "anchor": "drm-amdgpu-info-hw-ip",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-info-hw-ip",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 189,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L189",
              "doc": {
                "summary": "Output buffer for `AMDGPU_INFO_HW_IP_INFO`.",
                "description": [
                  "Reports the HW IP version and capabilities, ring-buffer alignment requirements, the bitmask of available kernel rings, and the count of user-queue slots — tier 2 checks both `available_rings` and `userq_num_slots` to confirm UMQ support."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output buffer for `AMDGPU_INFO_HW_IP_INFO`.\nReports the HW IP version and capabilities, ring-buffer alignment requirements, the bitmask of available kernel rings, and the count of user-queue slots — tier 2 checks both `available_rings` and `userq_num_slots` to confirm UMQ support."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuInfoUqMetadata",
              "qualified_name": "DrmAmdgpuInfoUqMetadata",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuInfoUqMetadata = extern union",
              "anchor": "drm-amdgpu-info-uq-metadata",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-info-uq-metadata",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 202,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L202",
              "doc": {
                "summary": "Output buffer for `AMDGPU_INFO_UQ_FW_AREAS`, sized per IP type.",
                "description": [
                  "Reports the per-queue scratch buffers the firmware needs: shadow/CSA areas for GFX, the EOP buffer for compute, and the CSA area for SDMA."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output buffer for `AMDGPU_INFO_UQ_FW_AREAS`, sized per IP type.\nReports the per-queue scratch buffers the firmware needs: shadow/CSA areas for GFX, the EOP buffer for compute, and the CSA area for SDMA."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuUserqIn",
              "qualified_name": "DrmAmdgpuUserqIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuUserqIn = extern struct",
              "anchor": "drm-amdgpu-userq-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-userq-in",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 221,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L221",
              "doc": {
                "summary": "Input layout for the `DRM_IOCTL_AMDGPU_USERQ` ioctl.",
                "description": [
                  "Describes the create/free op, the target IP (compute, gfx, sdma), the doorbell BO handle and slot offset within it, the VA ranges of the queue ring buffer plus its read/write pointers, and a pointer to the IP-specific MQD blob."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input layout for the `DRM_IOCTL_AMDGPU_USERQ` ioctl.\nDescribes the create/free op, the target IP (compute, gfx, sdma), the doorbell BO handle and slot offset within it, the VA ranges of the queue ring buffer plus its read/write pointers, and a pointer to the IP-specific MQD blob."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuUserqOut",
              "qualified_name": "DrmAmdgpuUserqOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuUserqOut = extern struct",
              "anchor": "drm-amdgpu-userq-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-userq-out",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 237,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L237",
              "doc": {
                "summary": "Output layout returned by a successful `AMDGPU_USERQ_OP_CREATE`, containing the kernel-assigned queue id used by subsequent ioctls.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output layout returned by a successful `AMDGPU_USERQ_OP_CREATE`, containing the kernel-assigned queue id used by subsequent ioctls."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuUserq",
              "qualified_name": "DrmAmdgpuUserq",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuUserq = extern union",
              "anchor": "drm-amdgpu-userq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-userq",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 243,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L243",
              "doc": {
                "summary": "Tagged union packing the in/out forms of the user-queue ioctl into the same buffer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union packing the in/out forms of the user-queue ioctl into the same buffer."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuUserqMqdComputeGfx11",
              "qualified_name": "DrmAmdgpuUserqMqdComputeGfx11",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuUserqMqdComputeGfx11 = extern struct",
              "anchor": "drm-amdgpu-userq-mqd-compute-gfx11",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#drm-amdgpu-userq-mqd-compute-gfx11",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 250,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L250",
              "doc": {
                "summary": "GFX11 compute MQD payload pointed at by `DrmAmdgpuUserqIn.mqd`.",
                "description": [
                  "Currently only the EOP scratch VA is required; matches the kernel's `drm_amdgpu_userq_mqd_compute_gfx11` layout."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GFX11 compute MQD payload pointed at by `DrmAmdgpuUserqIn.mqd`.\nCurrently only the EOP scratch VA is required; matches the kernel's `drm_amdgpu_userq_mqd_compute_gfx11` layout."
              },
              "members": []
            },
            {
              "name": "Bo",
              "qualified_name": "Bo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Bo = struct",
              "anchor": "bo",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#bo",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 256,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L256",
              "doc": {
                "summary": "Thin handle for a kernel-managed GEM buffer object.",
                "description": [
                  "Pairs the kernel GEM handle with the allocation size so callers can re-issue ioctls (mmap, VA map) without re-querying the size."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Thin handle for a kernel-managed GEM buffer object.\nPairs the kernel GEM handle with the allocation size so callers can re-issue ioctls (mmap, VA map) without re-querying the size."
              },
              "members": []
            },
            {
              "name": "queryComputeUserq",
              "qualified_name": "queryComputeUserq",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn queryComputeUserq(render_node: []const u8) QueryResult",
              "anchor": "query-compute-userq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#query-compute-userq",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 296,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L296",
              "doc": {
                "summary": "Probe an AMDGPU render node to decide whether the compute user-mode-queue surface is usable.",
                "description": [
                  "Opens the render node, asks the kernel for compute HW IP info plus user-queue firmware areas, and validates that the queue slots and EOP buffer parameters look sane."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Absolute path to the DRI render node (e.g. `/dev/dri/renderD128`)."
                  }
                ],
                "returns": "A `QueryResult` whose `status` field identifies the precise failure mode or `.available` on success, with `info` populated when compute UMQ is ready to use.",
                "notes": [
                  "Returns `.unsupported_os` immediately on non-Linux builds without opening any file."
                ],
                "raw": "Probe an AMDGPU render node to decide whether the compute user-mode-queue surface is usable.\nOpens the render node, asks the kernel for compute HW IP info plus user-queue firmware areas, and validates that the queue slots and EOP buffer parameters look sane."
              },
              "members": []
            },
            {
              "name": "queryHwIp",
              "qualified_name": "queryHwIp",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn queryHwIp(file: std.fs.File, ip_type: u32) !DrmAmdgpuInfoHwIp",
              "anchor": "query-hw-ip",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#query-hw-ip",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 346,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L346",
              "doc": {
                "summary": "Issue `AMDGPU_INFO_HW_IP_INFO` for the given HW IP type on an open render-node file.",
                "description": [],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node."
                  },
                  {
                    "name": "ip_type",
                    "description": "IP selector constant such as `AMDGPU_HW_IP_COMPUTE`."
                  }
                ],
                "returns": "The kernel-filled `DrmAmdgpuInfoHwIp` for IP instance 0.",
                "notes": [
                  "Returns `error.IoctlFailed` on failure; inspect `lastErrno()` for the captured errno."
                ],
                "raw": "Issue `AMDGPU_INFO_HW_IP_INFO` for the given HW IP type on an open render-node file."
              },
              "members": []
            },
            {
              "name": "createGem",
              "qualified_name": "createGem",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createGem(file: std.fs.File, size: u64, alignment: u64, domains: u64, flags: u64) !Bo",
              "anchor": "create-gem",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#create-gem",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 381,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L381",
              "doc": {
                "summary": "Allocate a GEM buffer object via `DRM_IOCTL_AMDGPU_GEM_CREATE`.",
                "description": [],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node."
                  },
                  {
                    "name": "size",
                    "description": "Buffer size in bytes."
                  },
                  {
                    "name": "alignment",
                    "description": "Required base alignment in bytes."
                  },
                  {
                    "name": "domains",
                    "description": "Bitmask of `AMDGPU_GEM_DOMAIN_*` constants selecting GTT, VRAM, or doorbell aperture."
                  },
                  {
                    "name": "flags",
                    "description": "Bitmask of `AMDGPU_GEM_CREATE_*` creation flags (e.g. USWC, VRAM-cleared, always-valid)."
                  }
                ],
                "returns": "A `Bo` wrapping the kernel GEM handle and the requested size for later mmap or VA-map calls.",
                "notes": [],
                "raw": "Allocate a GEM buffer object via `DRM_IOCTL_AMDGPU_GEM_CREATE`."
              },
              "members": []
            },
            {
              "name": "mmapGem",
              "qualified_name": "mmapGem",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn mmapGem(file: std.fs.File, bo: Bo, prot: u32) ![]align(std.heap.page_size_min) u8",
              "anchor": "mmap-gem",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#mmap-gem",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 402,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L402",
              "doc": {
                "summary": "Map a previously created GEM BO into the calling process's address space.",
                "description": [
                  "First queries the kernel for the BO's mmap offset, then issues a shared `mmap` against the render-node fd at that offset."
                ],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node that owns the BO."
                  },
                  {
                    "name": "bo",
                    "description": "The buffer object handle and size returned by `createGem`."
                  },
                  {
                    "name": "prot",
                    "description": "Standard POSIX `PROT_*` page-protection flags."
                  }
                ],
                "returns": "A page-aligned byte slice covering the BO; the slice length equals `bo.size`.",
                "notes": [],
                "raw": "Map a previously created GEM BO into the calling process's address space.\nFirst queries the kernel for the BO's mmap offset, then issues a shared `mmap` against the render-node fd at that offset."
              },
              "members": []
            },
            {
              "name": "mapGemVa",
              "qualified_name": "mapGemVa",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn mapGemVa(file: std.fs.File, bo: Bo, va: u64, flags: u32) !void",
              "anchor": "map-gem-va",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#map-gem-va",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 426,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L426",
              "doc": {
                "summary": "Bind a GEM BO into the device virtual address space at a caller-chosen VA.",
                "description": [
                  "Performs an `AMDGPU_VA_OP_MAP` over the full BO size starting at offset 0."
                ],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node that owns the BO."
                  },
                  {
                    "name": "bo",
                    "description": "The buffer object handle and size returned by `createGem`."
                  },
                  {
                    "name": "va",
                    "description": "Target GPU virtual address; must satisfy the page alignment the kernel enforces."
                  },
                  {
                    "name": "flags",
                    "description": "Bitmask of `AMDGPU_VM_PAGE_*` and `AMDGPU_VM_MTYPE_*` permission/cache flags."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Bind a GEM BO into the device virtual address space at a caller-chosen VA.\nPerforms an `AMDGPU_VA_OP_MAP` over the full BO size starting at offset 0."
              },
              "members": []
            },
            {
              "name": "createComputeUserq",
              "qualified_name": "createComputeUserq",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createComputeUserq( file: std.fs.File, doorbell_handle: u32, doorbell_offset: u32, queue_va: u64, queue_size: u64, rptr_va: u64, wptr_va: u64, eop_va: u64, flags: u32, ) !u32",
              "anchor": "create-compute-userq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#create-compute-userq",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 449,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L449",
              "doc": {
                "summary": "Create a compute user-mode queue via `DRM_IOCTL_AMDGPU_USERQ`.",
                "description": [
                  "Builds a GFX11 compute MQD pointing at the caller-supplied EOP scratch VA and submits an `AMDGPU_USERQ_OP_CREATE`."
                ],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node."
                  },
                  {
                    "name": "doorbell_handle",
                    "description": "GEM handle of the doorbell BO the kernel will use to wake this queue."
                  },
                  {
                    "name": "doorbell_offset",
                    "description": "Doorbell slot offset within the doorbell BO assigned to this queue."
                  },
                  {
                    "name": "queue_va",
                    "description": "Device VA of the ring buffer backing the queue."
                  },
                  {
                    "name": "queue_size",
                    "description": "Ring buffer size in bytes."
                  },
                  {
                    "name": "rptr_va",
                    "description": "Device VA of the queue read-pointer word."
                  },
                  {
                    "name": "wptr_va",
                    "description": "Device VA of the queue write-pointer word."
                  },
                  {
                    "name": "eop_va",
                    "description": "Device VA of the end-of-pipe scratch buffer required by GFX11 compute firmware."
                  },
                  {
                    "name": "flags",
                    "description": "Driver-specific creation flags forwarded as-is to the kernel."
                  }
                ],
                "returns": "The kernel-assigned queue id used in later doorbell rings and the matching `freeUserq` call.",
                "notes": [],
                "raw": "Create a compute user-mode queue via `DRM_IOCTL_AMDGPU_USERQ`.\nBuilds a GFX11 compute MQD pointing at the caller-supplied EOP scratch VA and submits an `AMDGPU_USERQ_OP_CREATE`."
              },
              "members": []
            },
            {
              "name": "freeUserq",
              "qualified_name": "freeUserq",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freeUserq(file: std.fs.File, queue_id: u32) !void",
              "anchor": "free-userq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#free-userq",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 483,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L483",
              "doc": {
                "summary": "Release a user-mode queue previously returned by `createComputeUserq` via `AMDGPU_USERQ_OP_FREE`.",
                "description": [],
                "params": [
                  {
                    "name": "file",
                    "description": "Open file handle for the AMDGPU render node that owns the queue."
                  },
                  {
                    "name": "queue_id",
                    "description": "Kernel-assigned queue id to free."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Release a user-mode queue previously returned by `createComputeUserq` via `AMDGPU_USERQ_OP_FREE`."
              },
              "members": []
            },
            {
              "name": "lastErrno",
              "qualified_name": "lastErrno",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn lastErrno() ?linux.E",
              "anchor": "last-errno",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kmd/#last-errno",
              "source_path": "src/zinc_rt/kmd.zig",
              "source_line": 509,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/kmd.zig#L509",
              "doc": {
                "summary": "Return the errno captured by the most recent ioctl performed through this module.",
                "description": [],
                "params": [],
                "returns": "The captured `linux.E` value, or `null` if the previous call succeeded or no call has been made yet.",
                "notes": [
                  "The module clears the saved errno at the start of every ioctl, so the value is only meaningful immediately after an `error.IoctlFailed`."
                ],
                "raw": "Return the errno captured by the most recent ioctl performed through this module."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "lib",
          "title": "Lib",
          "section": "Inference Runtime",
          "summary": "ZINC_RT reference-runtime module.",
          "overview": [
            "Exposes the M0 engine, IR, CPU ring, and scalar CPU kernels through one importable package so `forward_zinc_rt` can exercise the runtime without pulling the same files into multiple Zig modules."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/",
          "source_path": "src/zinc_rt/lib.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L10",
          "counts": {
            "code_lines": 18,
            "exports": 13,
            "methods": 0,
            "symbols": 13
          },
          "symbols": [
            {
              "name": "engine",
              "qualified_name": "engine",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const engine = @import(\"engine.zig\")",
              "anchor": "engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#engine",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L10",
              "doc": {
                "summary": "Top-level runtime handle and tier-selection helpers.",
                "description": [
                  "Other zinc_rt submodules go through this surface to obtain the active execution tier (CPU reference, T1 PM4, T2 UMQ, Metal, etc.)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Top-level runtime handle and tier-selection helpers.\nOther zinc_rt submodules go through this surface to obtain the active\nexecution tier (CPU reference, T1 PM4, T2 UMQ, Metal, etc.)."
              },
              "members": []
            },
            {
              "name": "ir_op",
              "qualified_name": "ir_op",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ir_op = @import(\"ir/op.zig\")",
              "anchor": "ir-op",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#ir-op",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L14",
              "doc": {
                "summary": "IR opcode definitions used by the M0/M1 decode graph.",
                "description": [
                  "Op kinds are stable identifiers shared by the emitter and the validator."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "IR opcode definitions used by the M0/M1 decode graph.\nOp kinds are stable identifiers shared by the emitter and the validator."
              },
              "members": []
            },
            {
              "name": "ir_graph",
              "qualified_name": "ir_graph",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ir_graph = @import(\"ir/graph.zig\")",
              "anchor": "ir-graph",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#ir-graph",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L19",
              "doc": {
                "summary": "IR graph container — nodes plus their op/argument metadata.",
                "description": [
                  "`forward_zinc_rt` emits one of these per token before lowering to the tier the engine selected."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "IR graph container — nodes plus their op/argument metadata.\n`forward_zinc_rt` emits one of these per token before lowering to the tier\nthe engine selected."
              },
              "members": []
            },
            {
              "name": "kmd",
              "qualified_name": "kmd",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const kmd = @import(\"kmd.zig\")",
              "anchor": "kmd",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#kmd",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 24,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L24",
              "doc": {
                "summary": "Kernel-mode-driver glue.",
                "description": [
                  "Houses helpers and constants shared by the ring backends (UMQ user queues, KFD compute queues) so they describe submissions in one place."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Kernel-mode-driver glue. Houses helpers and constants shared by the ring\nbackends (UMQ user queues, KFD compute queues) so they describe submissions\nin one place."
              },
              "members": []
            },
            {
              "name": "ring",
              "qualified_name": "ring",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ring = @import(\"ring/mod.zig\")",
              "anchor": "ring",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#ring",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L28",
              "doc": {
                "summary": "Common ring-submission surface — what every concrete ring backend (CPU, UMQ, KFD, CS) implements so the engine can speak to them uniformly.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Common ring-submission surface — what every concrete ring backend\n(CPU, UMQ, KFD, CS) implements so the engine can speak to them uniformly."
              },
              "members": []
            },
            {
              "name": "cpu_ring",
              "qualified_name": "cpu_ring",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const cpu_ring = @import(\"ring/cpu.zig\")",
              "anchor": "cpu-ring",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#cpu-ring",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 33,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L33",
              "doc": {
                "summary": "Reference CPU ring used by the scalar M1 forward path.",
                "description": [
                  "Executes ops synchronously on the host so we have a ground-truth correctness oracle for the GPU rings."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Reference CPU ring used by the scalar M1 forward path. Executes ops\nsynchronously on the host so we have a ground-truth correctness oracle for\nthe GPU rings."
              },
              "members": []
            },
            {
              "name": "umq",
              "qualified_name": "umq",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const umq = @import(\"ring/umq.zig\")",
              "anchor": "umq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#umq",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 37,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L37",
              "doc": {
                "summary": "T2 user-mode queue ring backed by `DRM_IOCTL_AMDGPU_USERQ`.",
                "description": [
                  "The \"blessed\" direct path when amdgpu firmware admits compute user queues."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "T2 user-mode queue ring backed by `DRM_IOCTL_AMDGPU_USERQ`. The \"blessed\"\ndirect path when amdgpu firmware admits compute user queues."
              },
              "members": []
            },
            {
              "name": "kfd",
              "qualified_name": "kfd",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const kfd = @import(\"ring/kfd.zig\")",
              "anchor": "kfd",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#kfd",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 41,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L41",
              "doc": {
                "summary": "T1 PM4 ring backed by `/dev/kfd` (the ROCm/tinygrad ABI).",
                "description": [
                  "Fallback when UMQ is rejected; talks PM4 packets to the compute scheduler directly."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "T1 PM4 ring backed by `/dev/kfd` (the ROCm/tinygrad ABI). Fallback when\nUMQ is rejected; talks PM4 packets to the compute scheduler directly."
              },
              "members": []
            },
            {
              "name": "cs",
              "qualified_name": "cs",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const cs = @import(\"ring/cs.zig\")",
              "anchor": "cs",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#cs",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 45,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L45",
              "doc": {
                "summary": "Generic libdrm compute-stream submission used by the PM4 backends.",
                "description": [
                  "Wraps context create/submit so the ring backends share one BO/syncobj path."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Generic libdrm compute-stream submission used by the PM4 backends.\nWraps context create/submit so the ring backends share one BO/syncobj path."
              },
              "members": []
            },
            {
              "name": "pm4_packet",
              "qualified_name": "pm4_packet",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const pm4_packet = @import(\"ring/packet.zig\")",
              "anchor": "pm4-packet",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#pm4-packet",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L50",
              "doc": {
                "summary": "PM4 packet builders (NOPs, indirect-buffer dispatch, COPY_DATA, fences).",
                "description": [
                  "Consumed by both the UMQ and KFD rings to produce wire-compatible command-buffer bytes."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "PM4 packet builders (NOPs, indirect-buffer dispatch, COPY_DATA, fences).\nConsumed by both the UMQ and KFD rings to produce wire-compatible\ncommand-buffer bytes."
              },
              "members": []
            },
            {
              "name": "kernels",
              "qualified_name": "kernels",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const kernels = @import(\"isa/cpu_zig/mod.zig\")",
              "anchor": "kernels",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#kernels",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 54,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L54",
              "doc": {
                "summary": "Scalar CPU kernels (dequantization, matvec, softmax, etc.) used by the reference forward path and by GPU-tier correctness checks.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Scalar CPU kernels (dequantization, matvec, softmax, etc.) used by the\nreference forward path and by GPU-tier correctness checks."
              },
              "members": []
            },
            {
              "name": "fast_pool",
              "qualified_name": "fast_pool",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const fast_pool = @import(\"fast_pool.zig\")",
              "anchor": "fast-pool",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#fast-pool",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 58,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L58",
              "doc": {
                "summary": "Tiny fixed-size worker pool used to fan out per-layer / per-expert work in the scalar M1 decode path without paying allocator/scheduler overhead.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tiny fixed-size worker pool used to fan out per-layer / per-expert work in\nthe scalar M1 decode path without paying allocator/scheduler overhead."
              },
              "members": []
            },
            {
              "name": "batching",
              "qualified_name": "batching",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const batching = @import(\"batching.zig\")",
              "anchor": "batching",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/lib/#batching",
              "source_path": "src/zinc_rt/lib.zig",
              "source_line": 62,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/lib.zig#L62",
              "doc": {
                "summary": "Tenant-aware admission and batch-selection primitives for the M3 continuous-batching executor.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tenant-aware admission and batch-selection primitives for the M3\ncontinuous-batching executor."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "cpu",
          "title": "Cpu",
          "section": "Inference Runtime",
          "summary": "T-CPU ring backend.",
          "overview": [
            "Walks packet batches and executes pure Zig kernels as the validation oracle used by every other ring tier (T1 PM4-direct, UMQ, Metal) to cross-check their outputs bit-for-bit against a reference run."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/cpu/",
          "source_path": "src/zinc_rt/ring/cpu.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cpu.zig#L12",
          "counts": {
            "code_lines": 20,
            "exports": 1,
            "methods": 2,
            "symbols": 3
          },
          "symbols": [
            {
              "name": "CpuRing",
              "qualified_name": "CpuRing",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CpuRing = struct",
              "anchor": "cpu-ring",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cpu/#cpu-ring",
              "source_path": "src/zinc_rt/ring/cpu.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cpu.zig#L12",
              "doc": {
                "summary": "T-CPU ring backend that executes packet batches synchronously on the CPU.",
                "description": [
                  "dispatch is run by the pure Zig kernels in `isa/cpu_zig/mod.zig`."
                ],
                "params": [],
                "returns": null,
                "notes": [
                  "Acts as the validation oracle for the GPU ring implementations; every"
                ],
                "raw": "T-CPU ring backend that executes packet batches synchronously on the CPU.\ndispatch is run by the pure Zig kernels in `isa/cpu_zig/mod.zig`."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "CpuRing.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init() CpuRing",
                  "anchor": "cpu-ring-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cpu/#cpu-ring-init",
                  "source_path": "src/zinc_rt/ring/cpu.zig",
                  "source_line": 15,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cpu.zig#L15",
                  "doc": {
                    "summary": "Construct a fresh CPU ring.",
                    "description": [
                      "The backend is stateless, so this is a trivial value initializer that exists to mirror the GPU ring API."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Construct a fresh CPU ring. The backend is stateless, so this is a\ntrivial value initializer that exists to mirror the GPU ring API."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "CpuRing.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(_: *CpuRing) void}",
                  "anchor": "cpu-ring-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cpu/#cpu-ring-deinit",
                  "source_path": "src/zinc_rt/ring/cpu.zig",
                  "source_line": 20,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cpu.zig#L20",
                  "doc": {
                    "summary": "Release any resources held by the ring.",
                    "description": [
                      "No-op for the CPU backend."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release any resources held by the ring. No-op for the CPU backend."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "cs",
          "title": "Cs",
          "section": "Inference Runtime",
          "summary": "AMDGPU DRM command-submission (CS) path — bring-up of the RADV / radeonsi PM4 submission foundation.",
          "overview": [
            "T1 PM4-direct reaches the AMD command processor through three Linux ABIs: * `DRM_IOCTL_AMDGPU_USERQ` — the user-mode-queue ABI; the bench-node firmware reports zero compute USERQ slots, so it is unusable here (see `umq.zig`). * `/dev/kfd` `AMDKFD_IOC_CREATE_QUEUE` + a doorbell ring — works to create a raw `QUEUE_TYPE_COMPUTE` queue, but the MES never retires the PM4 we stage in it on this kernel (see `kfd.zig`). * `DRM_IOCTL_AMDGPU_CS` — the kernel-managed command-submission UAPI every AMD userspace driver (RADV, radeonsi, amdvlk) rides. The kernel owns the ring / doorbell / MES bookkeeping; userspace hands it an indirect buffer (IB) of PM4 and waits on the retired fence. This is the reliable foundation the GPU compute dispatch lowers onto.",
            "This module brings the CS path's first retired PM4 batch up as a benchmark-visible gate: open the render node, query the compute HW IP, allocate an amdgpu context, create a persistent BO list for a GTT indirect-buffer BO plus data/signal/shader BOs, map them into the GPU VM at low VAs, submit PM4 streams through `DRM_IOCTL_AMDGPU_CS` using the same context/BO list, and wait for the returned fences with `DRM_IOCTL_AMDGPU_WAIT_CS`.",
            "This is not the final T1/T2 ring from the design; it is the kernel-managed CS baseline used to validate packet bytes, BO residency, VM mapping, and fence retirement before lowering real decode slices onto the direct tiers."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/",
          "source_path": "src/zinc_rt/ring/cs.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L37",
          "counts": {
            "code_lines": 3070,
            "exports": 38,
            "methods": 31,
            "symbols": 69
          },
          "symbols": [
            {
              "name": "default_render_node",
              "qualified_name": "default_render_node",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const default_render_node = \"/dev/dri/renderD128\"",
              "anchor": "default-render-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#default-render-node",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 37,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L37",
              "doc": {
                "summary": "Default DRM render node used by the CS bring-up gate when no path is provided.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Default DRM render node used by the CS bring-up gate when no path is provided."
              },
              "members": []
            },
            {
              "name": "AMDGPU_HW_IP_GFX",
              "qualified_name": "AMDGPU_HW_IP_GFX",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_HW_IP_GFX: u32 = 0",
              "anchor": "amdgpu-hw-ip-gfx",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-hw-ip-gfx",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 41,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L41",
              "doc": {
                "summary": "amdgpu HW IP block id for the graphics ring (uapi/drm/amdgpu_drm.h).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "amdgpu HW IP block id for the graphics ring (uapi/drm/amdgpu_drm.h)."
              },
              "members": []
            },
            {
              "name": "AMDGPU_HW_IP_COMPUTE",
              "qualified_name": "AMDGPU_HW_IP_COMPUTE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_HW_IP_COMPUTE: u32 = 1",
              "anchor": "amdgpu-hw-ip-compute",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-hw-ip-compute",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 43,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L43",
              "doc": {
                "summary": "amdgpu HW IP block id for the async compute ring used by ZINC submissions.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "amdgpu HW IP block id for the async compute ring used by ZINC submissions."
              },
              "members": []
            },
            {
              "name": "AMDGPU_CTX_OP_ALLOC_CTX",
              "qualified_name": "AMDGPU_CTX_OP_ALLOC_CTX",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_CTX_OP_ALLOC_CTX: u32 = 1",
              "anchor": "amdgpu-ctx-op-alloc-ctx",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-ctx-op-alloc-ctx",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 47,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L47",
              "doc": {
                "summary": "`DRM_AMDGPU_CTX` op selector for allocating a new submission context.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_CTX` op selector for allocating a new submission context."
              },
              "members": []
            },
            {
              "name": "AMDGPU_CTX_OP_FREE_CTX",
              "qualified_name": "AMDGPU_CTX_OP_FREE_CTX",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_CTX_OP_FREE_CTX: u32 = 2",
              "anchor": "amdgpu-ctx-op-free-ctx",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-ctx-op-free-ctx",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 49,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L49",
              "doc": {
                "summary": "`DRM_AMDGPU_CTX` op selector for releasing a previously allocated context.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_CTX` op selector for releasing a previously allocated context."
              },
              "members": []
            },
            {
              "name": "AMDGPU_BO_LIST_OP_CREATE",
              "qualified_name": "AMDGPU_BO_LIST_OP_CREATE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_BO_LIST_OP_CREATE: u32 = 0",
              "anchor": "amdgpu-bo-list-op-create",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-bo-list-op-create",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 53,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L53",
              "doc": {
                "summary": "`DRM_AMDGPU_BO_LIST` op selector to create a residency BO list handle.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_BO_LIST` op selector to create a residency BO list handle."
              },
              "members": []
            },
            {
              "name": "AMDGPU_BO_LIST_OP_DESTROY",
              "qualified_name": "AMDGPU_BO_LIST_OP_DESTROY",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_BO_LIST_OP_DESTROY: u32 = 1",
              "anchor": "amdgpu-bo-list-op-destroy",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-bo-list-op-destroy",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 55,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L55",
              "doc": {
                "summary": "`DRM_AMDGPU_BO_LIST` op selector to destroy a previously created BO list.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`DRM_AMDGPU_BO_LIST` op selector to destroy a previously created BO list."
              },
              "members": []
            },
            {
              "name": "AMDGPU_CHUNK_ID_IB",
              "qualified_name": "AMDGPU_CHUNK_ID_IB",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_CHUNK_ID_IB: u32 = 0x01",
              "anchor": "amdgpu-chunk-id-ib",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-chunk-id-ib",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 59,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L59",
              "doc": {
                "summary": "CS chunk id for an indirect-buffer descriptor (`DrmAmdgpuCsChunkIb`).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "CS chunk id for an indirect-buffer descriptor (`DrmAmdgpuCsChunkIb`)."
              },
              "members": []
            },
            {
              "name": "AMDGPU_CHUNK_ID_BO_HANDLES",
              "qualified_name": "AMDGPU_CHUNK_ID_BO_HANDLES",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_CHUNK_ID_BO_HANDLES: u32 = 0x06",
              "anchor": "amdgpu-chunk-id-bo-handles",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-chunk-id-bo-handles",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 61,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L61",
              "doc": {
                "summary": "CS chunk id for an inline BO-handles list, an alternative to a pre-created BO list.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "CS chunk id for an inline BO-handles list, an alternative to a pre-created BO list."
              },
              "members": []
            },
            {
              "name": "AMDGPU_IB_FLAG_EMIT_MEM_SYNC",
              "qualified_name": "AMDGPU_IB_FLAG_EMIT_MEM_SYNC",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const AMDGPU_IB_FLAG_EMIT_MEM_SYNC: u32 = 1 << 6",
              "anchor": "amdgpu-ib-flag-emit-mem-sync",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#amdgpu-ib-flag-emit-mem-sync",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 66,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L66",
              "doc": {
                "summary": "IB flag instructing the kernel to emit a memory-sync packet around the IB so writes from the BO list reach DRAM before/after the dispatch.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "IB flag instructing the kernel to emit a memory-sync packet around the IB\nso writes from the BO list reach DRAM before/after the dispatch."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCtxIn",
              "qualified_name": "DrmAmdgpuCtxIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCtxIn = extern struct",
              "anchor": "drm-amdgpu-ctx-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-ctx-in",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 77,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L77",
              "doc": {
                "summary": "Input payload of `DRM_IOCTL_AMDGPU_CTX`: selects an op and carries the caller-supplied `ctx_id` and submission priority for that op.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input payload of `DRM_IOCTL_AMDGPU_CTX`: selects an op and carries the\ncaller-supplied `ctx_id` and submission priority for that op."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCtxOutAlloc",
              "qualified_name": "DrmAmdgpuCtxOutAlloc",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCtxOutAlloc = extern struct",
              "anchor": "drm-amdgpu-ctx-out-alloc",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-ctx-out-alloc",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 86,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L86",
              "doc": {
                "summary": "Output payload of `AMDGPU_CTX_OP_ALLOC_CTX`: the kernel-assigned context id returned in the same `DrmAmdgpuCtx` union after a successful allocation.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output payload of `AMDGPU_CTX_OP_ALLOC_CTX`: the kernel-assigned context id\nreturned in the same `DrmAmdgpuCtx` union after a successful allocation."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCtxOutState",
              "qualified_name": "DrmAmdgpuCtxOutState",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCtxOutState = extern struct",
              "anchor": "drm-amdgpu-ctx-out-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-ctx-out-state",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 93,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L93",
              "doc": {
                "summary": "Output payload of the `AMDGPU_CTX_OP_QUERY_STATE` op: GPU reset state and hang counter for the queried context (unused on the bring-up path).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output payload of the `AMDGPU_CTX_OP_QUERY_STATE` op: GPU reset state and\nhang counter for the queried context (unused on the bring-up path)."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCtx",
              "qualified_name": "DrmAmdgpuCtx",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuCtx = extern union",
              "anchor": "drm-amdgpu-ctx",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-ctx",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 101,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L101",
              "doc": {
                "summary": "Tagged union passed to `DRM_IOCTL_AMDGPU_CTX` covering the input request and the two output shapes (alloc / query-state).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union passed to `DRM_IOCTL_AMDGPU_CTX` covering the input request\nand the two output shapes (alloc / query-state)."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuBoListIn",
              "qualified_name": "DrmAmdgpuBoListIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuBoListIn = extern struct",
              "anchor": "drm-amdgpu-bo-list-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-bo-list-in",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 110,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L110",
              "doc": {
                "summary": "Input payload of `DRM_IOCTL_AMDGPU_BO_LIST`: op selector plus a pointer to an array of `DrmAmdgpuBoListEntry` describing the BOs the submission must keep resident.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input payload of `DRM_IOCTL_AMDGPU_BO_LIST`: op selector plus a pointer to\nan array of `DrmAmdgpuBoListEntry` describing the BOs the submission must\nkeep resident."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuBoListOut",
              "qualified_name": "DrmAmdgpuBoListOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuBoListOut = extern struct",
              "anchor": "drm-amdgpu-bo-list-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-bo-list-out",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 120,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L120",
              "doc": {
                "summary": "Output payload of `AMDGPU_BO_LIST_OP_CREATE`: the kernel-assigned BO list handle referenced from subsequent CS submissions.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output payload of `AMDGPU_BO_LIST_OP_CREATE`: the kernel-assigned BO list\nhandle referenced from subsequent CS submissions."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuBoList",
              "qualified_name": "DrmAmdgpuBoList",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuBoList = extern union",
              "anchor": "drm-amdgpu-bo-list",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-bo-list",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 126,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L126",
              "doc": {
                "summary": "Tagged union passed to `DRM_IOCTL_AMDGPU_BO_LIST` covering input and output.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union passed to `DRM_IOCTL_AMDGPU_BO_LIST` covering input and output."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuBoListEntry",
              "qualified_name": "DrmAmdgpuBoListEntry",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuBoListEntry = extern struct",
              "anchor": "drm-amdgpu-bo-list-entry",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-bo-list-entry",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 133,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L133",
              "doc": {
                "summary": "Single residency entry inside a BO list: the GEM handle to make resident and a kernel-visible priority hint for eviction.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Single residency entry inside a BO list: the GEM handle to make resident\nand a kernel-visible priority hint for eviction."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCsChunk",
              "qualified_name": "DrmAmdgpuCsChunk",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCsChunk = extern struct",
              "anchor": "drm-amdgpu-cs-chunk",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-cs-chunk",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 140,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L140",
              "doc": {
                "summary": "One chunk inside a `DRM_IOCTL_AMDGPU_CS` submission: a typed sub-payload (`chunk_id`, length in dwords, pointer to the chunk data).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One chunk inside a `DRM_IOCTL_AMDGPU_CS` submission: a typed sub-payload\n(`chunk_id`, length in dwords, pointer to the chunk data)."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCsIn",
              "qualified_name": "DrmAmdgpuCsIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCsIn = extern struct",
              "anchor": "drm-amdgpu-cs-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-cs-in",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 148,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L148",
              "doc": {
                "summary": "Input payload of `DRM_IOCTL_AMDGPU_CS`: binds a context, BO list and an array of typed chunks (the IB descriptor lives in one of those chunks).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input payload of `DRM_IOCTL_AMDGPU_CS`: binds a context, BO list and an\narray of typed chunks (the IB descriptor lives in one of those chunks)."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCsOut",
              "qualified_name": "DrmAmdgpuCsOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCsOut = extern struct",
              "anchor": "drm-amdgpu-cs-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-cs-out",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 158,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L158",
              "doc": {
                "summary": "Output payload of `DRM_IOCTL_AMDGPU_CS`: the fence handle the caller waits on via `DRM_IOCTL_AMDGPU_WAIT_CS` for the submission to retire.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output payload of `DRM_IOCTL_AMDGPU_CS`: the fence handle the caller waits\non via `DRM_IOCTL_AMDGPU_WAIT_CS` for the submission to retire."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCs",
              "qualified_name": "DrmAmdgpuCs",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuCs = extern union",
              "anchor": "drm-amdgpu-cs",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-cs",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 163,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L163",
              "doc": {
                "summary": "Tagged union passed to `DRM_IOCTL_AMDGPU_CS` covering input and output.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union passed to `DRM_IOCTL_AMDGPU_CS` covering input and output."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuCsChunkIb",
              "qualified_name": "DrmAmdgpuCsChunkIb",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuCsChunkIb = extern struct",
              "anchor": "drm-amdgpu-cs-chunk-ib",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-cs-chunk-ib",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 171,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L171",
              "doc": {
                "summary": "Chunk payload for `AMDGPU_CHUNK_ID_IB`: describes the indirect-buffer VA, its size in bytes, the target IP type/ring, and submission flags such as `AMDGPU_IB_FLAG_EMIT_MEM_SYNC`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Chunk payload for `AMDGPU_CHUNK_ID_IB`: describes the indirect-buffer VA,\nits size in bytes, the target IP type/ring, and submission flags such as\n`AMDGPU_IB_FLAG_EMIT_MEM_SYNC`."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuWaitCsIn",
              "qualified_name": "DrmAmdgpuWaitCsIn",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuWaitCsIn = extern struct",
              "anchor": "drm-amdgpu-wait-cs-in",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-wait-cs-in",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 183,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L183",
              "doc": {
                "summary": "Input payload of `DRM_IOCTL_AMDGPU_WAIT_CS`: identifies the fence to wait on (by `handle`/`ctx_id` against a specific IP/ring) and the timeout.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Input payload of `DRM_IOCTL_AMDGPU_WAIT_CS`: identifies the fence to wait\non (by `handle`/`ctx_id` against a specific IP/ring) and the timeout."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuWaitCsOut",
              "qualified_name": "DrmAmdgpuWaitCsOut",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DrmAmdgpuWaitCsOut = extern struct",
              "anchor": "drm-amdgpu-wait-cs-out",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-wait-cs-out",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 194,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L194",
              "doc": {
                "summary": "Output payload of `DRM_IOCTL_AMDGPU_WAIT_CS`: zero on successful retirement, nonzero on timeout or fence error.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Output payload of `DRM_IOCTL_AMDGPU_WAIT_CS`: zero on successful retirement,\nnonzero on timeout or fence error."
              },
              "members": []
            },
            {
              "name": "DrmAmdgpuWaitCs",
              "qualified_name": "DrmAmdgpuWaitCs",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const DrmAmdgpuWaitCs = extern union",
              "anchor": "drm-amdgpu-wait-cs",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#drm-amdgpu-wait-cs",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 199,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L199",
              "doc": {
                "summary": "Tagged union passed to `DRM_IOCTL_AMDGPU_WAIT_CS` covering input and output.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union passed to `DRM_IOCTL_AMDGPU_WAIT_CS` covering input and output."
              },
              "members": []
            },
            {
              "name": "ArgmaxRangeResult",
              "qualified_name": "ArgmaxRangeResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ArgmaxRangeResult = struct",
              "anchor": "argmax-range-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#argmax-range-result",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 906,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L906",
              "doc": {
                "summary": "Result produced by the ordered-score argmax row-range kernel.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Result produced by the ordered-score argmax row-range kernel."
              },
              "members": []
            },
            {
              "name": "DmmvArgmaxResult",
              "qualified_name": "DmmvArgmaxResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvArgmaxResult = struct",
              "anchor": "dmmv-argmax-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#dmmv-argmax-result",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 913,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L913",
              "doc": {
                "summary": "Result produced by a quantized DMMV row-range kernel that performs its own in-kernel argmax over the computed rows.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Result produced by a quantized DMMV row-range kernel that performs its own\nin-kernel argmax over the computed rows."
              },
              "members": []
            },
            {
              "name": "PendingDmmvQ4_0RowRangeParallelChunks",
              "qualified_name": "PendingDmmvQ4_0RowRangeParallelChunks",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PendingDmmvQ4_0RowRangeParallelChunks = struct",
              "anchor": "pending-dmmv-q4-0-row-range-parallel-chunks",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#pending-dmmv-q4-0-row-range-parallel-chunks",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 922,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L922",
              "doc": {
                "summary": "In-flight Q4_0 row-range dispatch submitted through `DRM_IOCTL_AMDGPU_CS`.",
                "description": [
                  "Callers can overlap independent CPU work with this fence, then call `finish` before reusing the `TokenBoundary` maps or PM4 builder."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "In-flight Q4_0 row-range dispatch submitted through `DRM_IOCTL_AMDGPU_CS`.\n\nCallers can overlap independent CPU work with this fence, then call\n`finish` before reusing the `TokenBoundary` maps or PM4 builder."
              },
              "members": [
                {
                  "name": "finish",
                  "qualified_name": "PendingDmmvQ4_0RowRangeParallelChunks.finish",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn finish(self: PendingDmmvQ4_0RowRangeParallelChunks, output: []f32) !void",
                  "anchor": "pending-dmmv-q4-0-row-range-parallel-chunks-finish",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#pending-dmmv-q4-0-row-range-parallel-chunks-finish",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 930,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L930",
                  "doc": {
                    "summary": "Wait for the submitted CS fence, validate the signal sentinel, and copy the GPU-written row scores into `output`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Wait for the submitted CS fence, validate the signal sentinel, and copy\nthe GPU-written row scores into `output`."
                  }
                },
                {
                  "name": "waitDiscard",
                  "qualified_name": "PendingDmmvQ4_0RowRangeParallelChunks.waitDiscard",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn waitDiscard(self: PendingDmmvQ4_0RowRangeParallelChunks) void",
                  "anchor": "pending-dmmv-q4-0-row-range-parallel-chunks-wait-discard",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#pending-dmmv-q4-0-row-range-parallel-chunks-wait-discard",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 944,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L944",
                  "doc": {
                    "summary": "Retire the fence when the caller must abandon the result after submit.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Retire the fence when the caller must abandon the result after submit."
                  }
                }
              ]
            },
            {
              "name": "ResidentDmmvQ4_0Rows",
              "qualified_name": "ResidentDmmvQ4_0Rows",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ResidentDmmvQ4_0Rows = struct",
              "anchor": "resident-dmmv-q4-0-rows",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#resident-dmmv-q4-0-rows",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 954,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L954",
              "doc": {
                "summary": "Q4_0 row window staged once into the long-lived CS input BO.",
                "description": [
                  "This is still GTT-backed bring-up memory, not the final device-local weight residency model, but it lets the executed M1 LM-head proof stop copying the same weight rows into the dispatch scratch on every run."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Q4_0 row window staged once into the long-lived CS input BO.\n\nThis is still GTT-backed bring-up memory, not the final device-local weight\nresidency model, but it lets the executed M1 LM-head proof stop copying the\nsame weight rows into the dispatch scratch on every run."
              },
              "members": []
            },
            {
              "name": "SmokeStatus",
              "qualified_name": "SmokeStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const SmokeStatus = enum",
              "anchor": "smoke-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#smoke-status",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 966,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L966",
              "doc": {
                "summary": "Outcome classification for the CS bring-up smoke gate.",
                "description": [
                  "Each variant maps to a specific failure point in the open → submit → wait pipeline, so the benchmark UI can attribute a regression to render-node access, kernel ABI mismatch, BO/VA setup, submission, or fence retirement."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome classification for the CS bring-up smoke gate.\nEach variant maps to a specific failure point in the open → submit → wait\npipeline, so the benchmark UI can attribute a regression to render-node\naccess, kernel ABI mismatch, BO/VA setup, submission, or fence retirement."
              },
              "members": []
            },
            {
              "name": "SmokeResult",
              "qualified_name": "SmokeResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SmokeResult = struct",
              "anchor": "smoke-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#smoke-result",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 991,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L991",
              "doc": {
                "summary": "Structured result returned by the CS bring-up smoke gate.",
                "description": [
                  "Captures the rendezvous addresses, kernel-assigned handles, observed signal value, fence handles, and the final `SmokeStatus` so benchmark output can surface a precise failure mode without re-running the path."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Structured result returned by the CS bring-up smoke gate.\nCaptures the rendezvous addresses, kernel-assigned handles, observed signal\nvalue, fence handles, and the final `SmokeStatus` so benchmark output can\nsurface a precise failure mode without re-running the path."
              },
              "members": [
                {
                  "name": "ok",
                  "qualified_name": "SmokeResult.ok",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ok(self: SmokeResult) bool",
                  "anchor": "smoke-result-ok",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#smoke-result-ok",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1010,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1010",
                  "doc": {
                    "summary": "Returns true when both PM4 submissions retired and the signal BO read back the expected sentinel value.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Returns true when both PM4 submissions retired and the signal BO read\nback the expected sentinel value."
                  }
                }
              ]
            },
            {
              "name": "TokenBoundary",
              "qualified_name": "TokenBoundary",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const TokenBoundary = struct",
              "anchor": "token-boundary",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 1022,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1022",
              "doc": {
                "summary": "Per-token CS submission context for the PM4 bring-up tiers.",
                "description": [
                  "Owns the long-lived amdgpu context, BO list, and the GPU-mapped indirect- buffer / input / output / signal / shader buffers used by the `copyU32`, `argmaxTop2`, `rmsNormElement0` and `dmmvF32RowRange` dispatches. Reused across many submissions so each decode step only re-records PM4 into the existing IB and re-submits via `DRM_IOCTL_AMDGPU_CS`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-token CS submission context for the PM4 bring-up tiers.\n\nOwns the long-lived amdgpu context, BO list, and the GPU-mapped indirect-\nbuffer / input / output / signal / shader buffers used by the\n`copyU32`, `argmaxTop2`, `rmsNormElement0` and `dmmvF32RowRange` dispatches.\nReused across many submissions so each decode step only re-records PM4 into\nthe existing IB and re-submits via `DRM_IOCTL_AMDGPU_CS`."
              },
              "members": [
                {
                  "name": "initDefault",
                  "qualified_name": "TokenBoundary.initDefault",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initDefault() !TokenBoundary",
                  "anchor": "token-boundary-init-default",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-init-default",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1047,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1047",
                  "doc": {
                    "summary": "Open the canonical render node (`default_render_node`) and finish the full CS bring-up: context, BO list, IB / input / output / signal / shader buffers, all mapped into a low GPU VA range.",
                    "description": [],
                    "params": [],
                    "returns": "A ready `TokenBoundary` whose `builder` can record PM4 immediately.",
                    "notes": [],
                    "raw": "Open the canonical render node (`default_render_node`) and finish the\nfull CS bring-up: context, BO list, IB / input / output / signal /\nshader buffers, all mapped into a low GPU VA range."
                  }
                },
                {
                  "name": "initPath",
                  "qualified_name": "TokenBoundary.initPath",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initPath(render_node: []const u8) !TokenBoundary",
                  "anchor": "token-boundary-init-path",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-init-path",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1061,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1061",
                  "doc": {
                    "summary": "Open the given render node and bring up the full CS submission state.",
                    "description": [
                      "Allocates an amdgpu context, creates GTT-backed BOs for the indirect buffer, input scratch (~2 MiB), output, signal and shader pages, maps each into a fixed low GPU VA so the kernel does not need to re-bind them per submission, uploads the gfx1201 PM4 kernels into the shader page, and creates a persistent BO list referencing all five BOs."
                    ],
                    "params": [
                      {
                        "name": "render_node",
                        "description": "Absolute path to the amdgpu DRM render node (e.g. `/dev/dri/renderD128`)."
                      }
                    ],
                    "returns": "A ready `TokenBoundary` on success; the relevant `error.*Failed` variant otherwise.",
                    "notes": [
                      "Linux-only; returns `error.UnsupportedOs` on other platforms."
                    ],
                    "raw": "Open the given render node and bring up the full CS submission state.\n\nAllocates an amdgpu context, creates GTT-backed BOs for the indirect\nbuffer, input scratch (~2 MiB), output, signal and shader pages, maps\neach into a fixed low GPU VA so the kernel does not need to re-bind\nthem per submission, uploads the gfx1201 PM4 kernels into the\nshader page, and creates a persistent BO list referencing all five BOs."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "TokenBoundary.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *TokenBoundary) void",
                  "anchor": "token-boundary-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-deinit",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1178,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1178",
                  "doc": {
                    "summary": "Tear down every kernel resource the `init*` paths created: destroy the BO list, free the amdgpu context, `munmap` each CPU mapping, and close the render-node file descriptor.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [
                      "Leaves the struct in an `undefined` state; do not reuse it."
                    ],
                    "raw": "Tear down every kernel resource the `init*` paths created: destroy the\nBO list, free the amdgpu context, `munmap` each CPU mapping, and close\nthe render-node file descriptor."
                  }
                },
                {
                  "name": "copyU32",
                  "qualified_name": "TokenBoundary.copyU32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn copyU32(self: *TokenBoundary, value: u32) !u32",
                  "anchor": "token-boundary-copy-u32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-copy-u32",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1206,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1206",
                  "doc": {
                    "summary": "Round-trip one `u32` through the GPU as the simplest end-to-end gate: PM4 `COPY_DATA` from the input page to the output page, plus a `WRITE_DATA` of a per-submission sentinel into the signal page.",
                    "description": [],
                    "params": [
                      {
                        "name": "value",
                        "description": "32-bit payload to copy."
                      }
                    ],
                    "returns": "The value the GPU wrote into `output_map[0]`.",
                    "notes": [
                      "Returns `error.SignalMismatch` if the post-fence signal value does not match the expected sentinel."
                    ],
                    "raw": "Round-trip one `u32` through the GPU as the simplest end-to-end gate:\nPM4 `COPY_DATA` from the input page to the output page, plus a\n`WRITE_DATA` of a per-submission sentinel into the signal page."
                  }
                },
                {
                  "name": "produceToken",
                  "qualified_name": "TokenBoundary.produceToken",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn produceToken(self: *TokenBoundary, token_id: u32) !u32",
                  "anchor": "token-boundary-produce-token",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-produce-token",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1261,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1261",
                  "doc": {
                    "summary": "Alias for `copyU32` framed as the per-token decode pulse: prove the GPU produced a token by round-tripping its id through a real PM4 submission and fence wait.",
                    "description": [],
                    "params": [
                      {
                        "name": "token_id",
                        "description": "Token id to round-trip through the GPU."
                      }
                    ],
                    "returns": "The id the GPU echoed back into the output page.",
                    "notes": [],
                    "raw": "Alias for `copyU32` framed as the per-token decode pulse: prove the\nGPU produced a token by round-tripping its id through a real PM4\nsubmission and fence wait."
                  }
                },
                {
                  "name": "argmaxTop2",
                  "qualified_name": "TokenBoundary.argmaxTop2",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn argmaxTop2( self: *TokenBoundary, token0: u32, score0: f32, token1: u32, score1: f32, ) !u32",
                  "anchor": "token-boundary-argmax-top2",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-argmax-top2",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1277,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1277",
                  "doc": {
                    "summary": "Dispatch the gfx1201 top-2 argmax kernel and return the selected token.",
                    "description": [
                      "Loads the argmax program into the compute SGPRs, packs the output VA, two ordered scores, and two token ids into `compute_user_data_2..7`, fires one workgroup, then waits on the signal sentinel before reading the kernel-chosen token from the output page."
                    ],
                    "params": [
                      {
                        "name": "token0",
                        "description": "First candidate token id."
                      },
                      {
                        "name": "score0",
                        "description": "Logit/score for `token0` (compared via ordered f32 bits)."
                      },
                      {
                        "name": "token1",
                        "description": "Second candidate token id."
                      },
                      {
                        "name": "score1",
                        "description": "Logit/score for `token1`."
                      }
                    ],
                    "returns": "Whichever of `token0`/`token1` the kernel selected.",
                    "notes": [
                      "Returns `error.SignalMismatch` on fence mismatch or `error.ArgmaxTop2InvalidToken` if the kernel writes anything else."
                    ],
                    "raw": "Dispatch the gfx1201 top-2 argmax kernel and return the selected token.\n\nLoads the argmax program into the compute SGPRs, packs the output VA,\ntwo ordered scores, and two token ids into `compute_user_data_2..7`, fires\none workgroup, then waits on the signal sentinel before reading the\nkernel-chosen token from the output page."
                  }
                },
                {
                  "name": "argmaxF32Range",
                  "qualified_name": "TokenBoundary.argmaxF32Range",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn argmaxF32Range( self: *TokenBoundary, scores: []const f32, start_row: u32, ) !ArgmaxRangeResult",
                  "anchor": "token-boundary-argmax-f32-range",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-argmax-f32-range",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1370,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1370",
                  "doc": {
                    "summary": "Dispatch the gfx1201 ordered-score row-range argmax kernel.",
                    "description": [
                      "Converts `scores` into sortable u32 keys, copies them into the shared input page, then lets the compute ring select the max row. The returned token id is absolute: `start_row + local_best`."
                    ],
                    "params": [
                      {
                        "name": "scores",
                        "description": "F32 logit/score row range to select from."
                      },
                      {
                        "name": "start_row",
                        "description": "Absolute token row corresponding to `scores[0]`."
                      }
                    ],
                    "returns": "The selected absolute token id and the ordered score key the GPU stored.",
                    "notes": [],
                    "raw": "Dispatch the gfx1201 ordered-score row-range argmax kernel.\n\nConverts `scores` into sortable u32 keys, copies them into the shared\ninput page, then lets the compute ring select the max row. The returned\ntoken id is absolute: `start_row + local_best`."
                  }
                },
                {
                  "name": "rmsNormElement0",
                  "qualified_name": "TokenBoundary.rmsNormElement0",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn rmsNormElement0( self: *TokenBoundary, hidden0: f32, inv_rms: f32, weight0: f32, ) !f32",
                  "anchor": "token-boundary-rms-norm-element0",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-rms-norm-element0",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1476,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1476",
                  "doc": {
                    "summary": "Dispatch the single-element gfx1201 final-RMS-norm kernel.",
                    "description": [
                      "Stores `hidden0 * inv_rms * weight0` into `output_map[0]` via a real PM4 dispatch on the compute ring, with a signal sentinel verifying retirement."
                    ],
                    "params": [
                      {
                        "name": "hidden0",
                        "description": "First hidden-state element."
                      },
                      {
                        "name": "inv_rms",
                        "description": "Pre-computed inverse RMS scale."
                      },
                      {
                        "name": "weight0",
                        "description": "First RMS-norm weight."
                      }
                    ],
                    "returns": "The fused `hidden0 * inv_rms * weight0` value the GPU produced.",
                    "notes": [
                      "Returns `error.SignalMismatch` if the signal sentinel does not match the expected per-submission value."
                    ],
                    "raw": "Dispatch the single-element gfx1201 final-RMS-norm kernel.\n\nStores `hidden0 * inv_rms * weight0` into `output_map[0]` via a real\nPM4 dispatch on the compute ring, with a signal sentinel verifying\nretirement."
                  }
                },
                {
                  "name": "dmmvF32RowRange",
                  "qualified_name": "TokenBoundary.dmmvF32RowRange",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvF32RowRange( self: *TokenBoundary, input: []const f32, weights_f32: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-f32-row-range",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-f32-row-range",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1580,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1580",
                  "doc": {
                    "summary": "Dispatch the gfx1201 row-range f32 dense matrix-vector kernel.",
                    "description": [
                      "Copies the input vector and the row-major f32 weight block into the shared input page (64-byte aligned), records PM4 that points the kernel at the input/weights/output pages and the `rows`/`cols` arguments, and waits on the signal sentinel before reading `output`. This is the first row-oriented dense compute kernel the CS path runs; `cols` must be a multiple of 64 and `output` must hold at least `rows` elements."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_f32",
                        "description": "Row-major weight bytes; must hold at least `rows*cols*4` bytes."
                      },
                      {
                        "name": "rows",
                        "description": "Number of output rows to compute."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 64."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving `rows` f32 values."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Returns `error.ShapeMismatch`, `error.InputTooLarge`, `error.OutputTooLarge`, or `error.SignalMismatch` on invalid shapes or signal-readback failure."
                    ],
                    "raw": "Dispatch the gfx1201 row-range f32 dense matrix-vector kernel.\n\nCopies the input vector and the row-major f32 weight block into the\nshared input page (64-byte aligned), records PM4 that points the\nkernel at the input/weights/output pages and the `rows`/`cols`\narguments, and waits on the signal sentinel before reading `output`.\nThis is the first row-oriented dense compute kernel the CS path runs;\n`cols` must be a multiple of 64 and `output` must hold at least `rows`\nelements."
                  }
                },
                {
                  "name": "dmmvF32TwoRowRanges",
                  "qualified_name": "TokenBoundary.dmmvF32TwoRowRanges",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvF32TwoRowRanges( self: *TokenBoundary, input: []const f32, weights_a_f32: []const u8, rows_a: u32, weights_b_f32: []const u8, rows_b: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-f32-two-row-ranges",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-f32-two-row-ranges",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1690,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1690",
                  "doc": {
                    "summary": "Dispatch one F32 DMMV kernel over two packed row ranges sharing the same input vector.",
                    "description": [
                      "This is used by the M1 SSM bridge to consume alpha and beta projection rows in one CS submission when both tensors are F32. The existing row-range shader sees one compact `rows_a + rows_b` matrix; output rows are written in that same order."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch one F32 DMMV kernel over two packed row ranges sharing the same input vector.\n\nThis is used by the M1 SSM bridge to consume alpha and beta projection\nrows in one CS submission when both tensors are F32. The existing\nrow-range shader sees one compact `rows_a + rows_b` matrix; output rows\nare written in that same order."
                  }
                },
                {
                  "name": "dmmvQ4_0RowRange",
                  "qualified_name": "TokenBoundary.dmmvQ4_0RowRange",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0RowRange( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-row-range",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-row-range",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1814,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1814",
                  "doc": {
                    "summary": "Dispatch the gfx1201 row-range Q4_0 matrix-vector kernel.",
                    "description": [
                      "Copies the input vector and raw GGML Q4_0 rows into the shared input page, records PM4 for one serial workitem over `rows`, and reads back one f32 result per row. This intentionally validates real quantized model bytes through the native CS path while the full K-parallel DMMV kernel is still under construction."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_q4_0",
                        "description": "Row-major GGML Q4_0 row bytes; must hold at least `rows * (cols/32*18)` bytes."
                      },
                      {
                        "name": "rows",
                        "description": "Number of output rows to compute."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving `rows` f32 values."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the gfx1201 row-range Q4_0 matrix-vector kernel.\n\nCopies the input vector and raw GGML Q4_0 rows into the shared input page,\nrecords PM4 for one serial workitem over `rows`, and reads back one f32\nresult per row. This intentionally validates real quantized model bytes\nthrough the native CS path while the full K-parallel DMMV kernel is still\nunder construction."
                  }
                },
                {
                  "name": "dmmvQ4_0RowRangeParallel",
                  "qualified_name": "TokenBoundary.dmmvQ4_0RowRangeParallel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0RowRangeParallel( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-row-range-parallel",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-row-range-parallel",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 1930,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L1930",
                  "doc": {
                    "summary": "Dispatch the wave-lane gfx1201 Q4_0 matrix-vector kernel for exactly 64 rows in parallel.",
                    "description": [
                      "Stages the same source-format rows as `dmmvQ4_0RowRange`, but launches one wave64 workgroup where each lane computes one row. Intended for 64-row LM-head prefix/window ranges where the GPU row values participate in choosing the sampled token."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_q4_0",
                        "description": "Row-major GGML Q4_0 row bytes; must hold exactly 64 rows."
                      },
                      {
                        "name": "rows",
                        "description": "Must be exactly 64; any other value returns `error.ShapeMismatch`."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving 64 f32 values (one per row)."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Returns `error.SignalMismatch` if the post-fence signal value does not match the expected sentinel."
                    ],
                    "raw": "Dispatch the wave-lane gfx1201 Q4_0 matrix-vector kernel for exactly 64 rows in parallel.\n\nStages the same source-format rows as `dmmvQ4_0RowRange`, but launches\none wave64 workgroup where each lane computes one row. Intended for\n64-row LM-head prefix/window ranges where the GPU row values participate\nin choosing the sampled token."
                  }
                },
                {
                  "name": "sgprTgidProbe",
                  "qualified_name": "TokenBoundary.sgprTgidProbe",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sgprTgidProbe(self: *TokenBoundary, groups: u32, out: []u32) !void",
                  "anchor": "token-boundary-sgpr-tgid-probe",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-sgpr-tgid-probe",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2039,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2039",
                  "doc": {
                    "summary": "Dispatch the multi-workgroup TGID-delivery probe: `groups` workgroups, one workitem each, each storing its `workgroup_id_x` (SGPR s8) at `out[workgroup_id_x]`.",
                    "description": [
                      "A correct dispatch yields `out[0..groups] = [0,1,...,groups-1]`; if TGID is not delivered, every workgroup collides at `out[0]`. Validates the grid-over-rows premise of the resident DMMV."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the multi-workgroup TGID-delivery probe: `groups` workgroups,\none workitem each, each storing its `workgroup_id_x` (SGPR s8) at\n`out[workgroup_id_x]`. A correct dispatch yields `out[0..groups] =\n[0,1,...,groups-1]`; if TGID is not delivered, every workgroup collides\nat `out[0]`. Validates the grid-over-rows premise of the resident DMMV."
                  }
                },
                {
                  "name": "sgprTgidDump",
                  "qualified_name": "TokenBoundary.sgprTgidDump",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sgprTgidDump(self: *TokenBoundary, groups: u32, out: []u32) !void",
                  "anchor": "token-boundary-sgpr-tgid-dump",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-sgpr-tgid-dump",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2110,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2110",
                  "doc": {
                    "summary": "Dispatch the exhaustive TGID-slot probe (`tgid_dump`): `groups` workgroups scan candidate SGPRs s8..s19 and store each candidate value via a value-as-index trick.",
                    "description": [
                      "Fills `out[0..out.len]` from the output BO; the caller decodes which candidate slot reads [0,1,...] across workgroups. `out[960]` reads 0x53475052 (\"SGPR\") iff the kernel ran."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the exhaustive TGID-slot probe (`tgid_dump`): `groups`\nworkgroups scan candidate SGPRs s8..s19 and store each candidate value\nvia a value-as-index trick. Fills `out[0..out.len]` from the output BO;\nthe caller decodes which candidate slot reads [0,1,...] across\nworkgroups. `out[960]` reads 0x53475052 (\"SGPR\") iff the kernel ran."
                  }
                },
                {
                  "name": "dmmvQ4_0ResidentGrid",
                  "qualified_name": "TokenBoundary.dmmvQ4_0ResidentGrid",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0ResidentGrid( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-resident-grid",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-resident-grid",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2187,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2187",
                  "doc": {
                    "summary": "Grid-over-rows Q4_0 dequant-matvec.",
                    "description": [
                      "Stages `input` + `weights_q4_0` into the input BO, dispatches ceil(rows/64) workgroups (each picks its 64-row block from workgroup_id_x/ttmp9), and reads back `rows` results in ONE submit. This is the correctness path (weights staged per call); the perf path will instead point s[4:5] at a VRAM-resident weight BO."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Grid-over-rows Q4_0 dequant-matvec. Stages `input` + `weights_q4_0` into\nthe input BO, dispatches ceil(rows/64) workgroups (each picks its 64-row\nblock from workgroup_id_x/ttmp9), and reads back `rows` results in ONE\nsubmit. This is the correctness path (weights staged per call); the perf\npath will instead point s[4:5] at a VRAM-resident weight BO."
                  }
                },
                {
                  "name": "probeVramMappable",
                  "qualified_name": "TokenBoundary.probeVramMappable",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn probeVramMappable(self: *TokenBoundary, size: usize) !bool",
                  "anchor": "token-boundary-probe-vram-mappable",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-probe-vram-mappable",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2283,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2283",
                  "doc": {
                    "summary": "One-shot check that a `size`-byte VRAM BO is CPU-mappable (large-BAR) and round-trips a host write/read.",
                    "description": [
                      "Gates the resident-weight LM-head matvec, which only beats the CPU if the weight lives in VRAM (576 GB/s) rather than GTT (PCIe-bound). Leaks the probe BO (reclaimed at process exit)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "One-shot check that a `size`-byte VRAM BO is CPU-mappable (large-BAR) and\nround-trips a host write/read. Gates the resident-weight LM-head matvec,\nwhich only beats the CPU if the weight lives in VRAM (576 GB/s) rather\nthan GTT (PCIe-bound). Leaks the probe BO (reclaimed at process exit)."
                  }
                },
                {
                  "name": "dmmvQ4_0RowPartial64",
                  "qualified_name": "TokenBoundary.dmmvQ4_0RowPartial64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0RowPartial64( self: *TokenBoundary, input: []const f32, row_q4_0: []const u8, cols: u32, partials_out: ?[]f32, ) !f32",
                  "anchor": "token-boundary-dmmv-q4-0-row-partial64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-row-partial64",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2312,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2312",
                  "doc": {
                    "summary": "Dispatch the wave64 Q4_0 single-row partial-sum kernel and reduce it on the host.",
                    "description": [
                      "This lowers one real model row through a K-parallel CS kernel: lanes 0..31 each accumulate one column per Q4_0 block, the kernel writes 64 partial sums, and the host performs the final scalar reduction. The caller may pass `partials_out` to inspect the raw lane outputs."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "row_q4_0",
                        "description": "Raw GGML Q4_0 bytes for one row; must hold `(cols/32)*18` bytes."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "partials_out",
                        "description": "Optional output slice receiving 64 f32 partial sums."
                      }
                    ],
                    "returns": "Reduced dot-product score.",
                    "notes": [],
                    "raw": "Dispatch the wave64 Q4_0 single-row partial-sum kernel and reduce it on the host.\n\nThis lowers one real model row through a K-parallel CS kernel: lanes\n0..31 each accumulate one column per Q4_0 block, the kernel writes 64\npartial sums, and the host performs the final scalar reduction. The\ncaller may pass `partials_out` to inspect the raw lane outputs."
                  }
                },
                {
                  "name": "dmmvQ4_0RowRangeParallelChunks",
                  "qualified_name": "TokenBoundary.dmmvQ4_0RowRangeParallelChunks",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0RowRangeParallelChunks( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-row-range-parallel-chunks",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-row-range-parallel-chunks",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2437,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2437",
                  "doc": {
                    "summary": "Dispatch one or more 64-row wave-lane Q4_0 DMMV chunks in a single CS submission.",
                    "description": [
                      "Each chunk runs the same source-format row-parallel shader as `dmmvQ4_0RowRangeParallel`; this helper stages a larger adjacent row window, emits one dispatch per 64-row chunk into the same IB, and waits once after the final release fence. The output slice receives all rows in order."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_q4_0",
                        "description": "Row-major GGML Q4_0 row bytes; must hold `rows` rows."
                      },
                      {
                        "name": "rows",
                        "description": "Number of rows to compute; must be a positive multiple of 64."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving `rows` f32 values."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch one or more 64-row wave-lane Q4_0 DMMV chunks in a single CS submission.\n\nEach chunk runs the same source-format row-parallel shader as\n`dmmvQ4_0RowRangeParallel`; this helper stages a larger adjacent row\nwindow, emits one dispatch per 64-row chunk into the same IB, and waits\nonce after the final release fence. The output slice receives all rows\nin order."
                  }
                },
                {
                  "name": "stageDmmvQ4_0RowsResident",
                  "qualified_name": "TokenBoundary.stageDmmvQ4_0RowsResident",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn stageDmmvQ4_0RowsResident( self: *TokenBoundary, weights_q4_0: []const u8, rows: u32, cols: u32, ) !ResidentDmmvQ4_0Rows",
                  "anchor": "token-boundary-stage-dmmv-q4-0-rows-resident",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-stage-dmmv-q4-0-rows-resident",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2454,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2454",
                  "doc": {
                    "summary": "Stage a Q4_0 row window into the high end of the long-lived input BO.",
                    "description": [
                      "The returned handle is valid until another caller overwrites the same resident region. Default M1 generation uses it for the first LM-head prefix proof, before any broad validation slices can reuse the scratch."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Stage a Q4_0 row window into the high end of the long-lived input BO.\n\nThe returned handle is valid until another caller overwrites the same\nresident region. Default M1 generation uses it for the first LM-head\nprefix proof, before any broad validation slices can reuse the scratch."
                  }
                },
                {
                  "name": "beginDmmvQ4_0RowRangeParallelChunksResident",
                  "qualified_name": "TokenBoundary.beginDmmvQ4_0RowRangeParallelChunksResident",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn beginDmmvQ4_0RowRangeParallelChunksResident( self: *TokenBoundary, input: []const f32, resident: ResidentDmmvQ4_0Rows, ) !PendingDmmvQ4_0RowRangeParallelChunks",
                  "anchor": "token-boundary-begin-dmmv-q4-0-row-range-parallel-chunks-resident",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-begin-dmmv-q4-0-row-range-parallel-chunks-resident",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2485,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2485",
                  "doc": {
                    "summary": "Dispatch a previously staged resident Q4_0 row window.",
                    "description": [
                      "Only the activation vector is copied for this submission; PM4 points the shader at the resident weight VA in the shared input BO."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch a previously staged resident Q4_0 row window.\n\nOnly the activation vector is copied for this submission; PM4 points the\nshader at the resident weight VA in the shared input BO."
                  }
                },
                {
                  "name": "beginDmmvQ4_0RowRangeParallelChunks",
                  "qualified_name": "TokenBoundary.beginDmmvQ4_0RowRangeParallelChunks",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn beginDmmvQ4_0RowRangeParallelChunks( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, ) !PendingDmmvQ4_0RowRangeParallelChunks",
                  "anchor": "token-boundary-begin-dmmv-q4-0-row-range-parallel-chunks",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-begin-dmmv-q4-0-row-range-parallel-chunks",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2504,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2504",
                  "doc": {
                    "summary": "Submit one or more 64-row wave-lane Q4_0 chunks and return before waiting for the CS fence.",
                    "description": [
                      "The shared input/output/signal maps and PM4 builder must not be reused until the returned dispatch is finished."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Submit one or more 64-row wave-lane Q4_0 chunks and return before\nwaiting for the CS fence. The shared input/output/signal maps and PM4\nbuilder must not be reused until the returned dispatch is finished."
                  }
                },
                {
                  "name": "dmmvQ4_0TwoRowRangesParallel64",
                  "qualified_name": "TokenBoundary.dmmvQ4_0TwoRowRangesParallel64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0TwoRowRangesParallel64( self: *TokenBoundary, input: []const f32, weights_a_q4_0: []const u8, weights_b_q4_0: []const u8, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-two-row-ranges-parallel64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-two-row-ranges-parallel64",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2645,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2645",
                  "doc": {
                    "summary": "Dispatch two 64-row Q4_0 DMMV ranges that share one input vector in one CS submission.",
                    "description": [
                      "The two ranges are staged back-to-back, then the existing 64-lane Q4_0 row-parallel kernel is dispatched twice in the same IB. The output slice receives A's 64 rows first and B's 64 rows second. This is used by the M1 forward bridge to consume a wider routed MoE gate/up slice without adding a second fence wait."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_a_q4_0",
                        "description": "Row-major GGML Q4_0 bytes for range A; must hold exactly 64 rows."
                      },
                      {
                        "name": "weights_b_q4_0",
                        "description": "Row-major GGML Q4_0 bytes for range B; must hold exactly 64 rows."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving 128 f32 values: A rows first, then B rows."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch two 64-row Q4_0 DMMV ranges that share one input vector in one CS submission.\n\nThe two ranges are staged back-to-back, then the existing 64-lane Q4_0\nrow-parallel kernel is dispatched twice in the same IB. The output slice\nreceives A's 64 rows first and B's 64 rows second. This is used by the\nM1 forward bridge to consume a wider routed MoE gate/up slice without\nadding a second fence wait."
                  }
                },
                {
                  "name": "dmmvQ4_0FourRowRangesParallel64",
                  "qualified_name": "TokenBoundary.dmmvQ4_0FourRowRangesParallel64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0FourRowRangesParallel64( self: *TokenBoundary, input: []const f32, weights_a_q4_0: []const u8, weights_b_q4_0: []const u8, weights_c_q4_0: []const u8, weights_d_q4_0: []const u8, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-four-row-ranges-parallel64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-four-row-ranges-parallel64",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2761,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2761",
                  "doc": {
                    "summary": "Dispatch four 64-row Q4_0 DMMV ranges that share one input vector in one CS submission.",
                    "description": [
                      "This is the batched companion to `dmmvQ4_0TwoRowRangesParallel64` for decode-phase MoE gate/up validation across two routed experts. The output slice receives A, B, C, D ranges in order."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch four 64-row Q4_0 DMMV ranges that share one input vector in one CS submission.\n\nThis is the batched companion to `dmmvQ4_0TwoRowRangesParallel64` for\ndecode-phase MoE gate/up validation across two routed experts. The\noutput slice receives A, B, C, D ranges in order."
                  }
                },
                {
                  "name": "dmmvQ4_0TwoRows",
                  "qualified_name": "TokenBoundary.dmmvQ4_0TwoRows",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0TwoRows( self: *TokenBoundary, input: []const f32, row_a_q4_0: []const u8, row_b_q4_0: []const u8, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q4-0-two-rows",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-two-rows",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 2893,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L2893",
                  "doc": {
                    "summary": "Dispatch Q4_0 DMMV for two arbitrary model rows staged back-to-back.",
                    "description": [
                      "The caller supplies two individual source-format rows, which are packed into the shared staging page as a compact two-row matrix. This lets the current forward path obtain both LM-head top-2 scores from one real DMMV row-range submission even when the rows are not adjacent in vocab."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "row_a_q4_0",
                        "description": "Raw GGML Q4_0 bytes for the first row; must hold at least `(cols/32)*18` bytes."
                      },
                      {
                        "name": "row_b_q4_0",
                        "description": "Raw GGML Q4_0 bytes for the second row; same size requirement as `row_a_q4_0`."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving 2 f32 values: `output[0]` for row A, `output[1]` for row B."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Returns `error.SignalMismatch` if the post-fence signal sentinel does not match."
                    ],
                    "raw": "Dispatch Q4_0 DMMV for two arbitrary model rows staged back-to-back.\n\nThe caller supplies two individual source-format rows, which are packed\ninto the shared staging page as a compact two-row matrix. This lets the\ncurrent forward path obtain both LM-head top-2 scores from one real\nDMMV row-range submission even when the rows are not adjacent in vocab."
                  }
                },
                {
                  "name": "dmmvQ4_0ArgmaxRowRange",
                  "qualified_name": "TokenBoundary.dmmvQ4_0ArgmaxRowRange",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ4_0ArgmaxRowRange( self: *TokenBoundary, input: []const f32, weights_q4_0: []const u8, rows: u32, cols: u32, ) !DmmvArgmaxResult",
                  "anchor": "token-boundary-dmmv-q4-0-argmax-row-range",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q4-0-argmax-row-range",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 3008,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3008",
                  "doc": {
                    "summary": "Dispatch the gfx1201 Q4_0 row-range DMMV kernel that performs argmax in the same submission.",
                    "description": [
                      "The method stages the exact same source-format input and Q4_0 rows as `dmmvQ4_0RowRange`, but the kernel only stores the local best row and score. The forward path uses this for LM-head prefix/window candidates so a GPU-produced model value can directly participate in sampling without a follow-up direct argmax dispatch over copied logits."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the gfx1201 Q4_0 row-range DMMV kernel that performs argmax in\nthe same submission.\n\nThe method stages the exact same source-format input and Q4_0 rows as\n`dmmvQ4_0RowRange`, but the kernel only stores the local best row and\nscore. The forward path uses this for LM-head prefix/window candidates\nso a GPU-produced model value can directly participate in sampling\nwithout a follow-up direct argmax dispatch over copied logits."
                  }
                },
                {
                  "name": "dmmvQ8_0RowRange",
                  "qualified_name": "TokenBoundary.dmmvQ8_0RowRange",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ8_0RowRange( self: *TokenBoundary, input: []const f32, weights_q8_0: []const u8, rows: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q8-0-row-range",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q8-0-row-range",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 3127,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3127",
                  "doc": {
                    "summary": "Dispatch the gfx1201 row-range Q8_0 matrix-vector kernel.",
                    "description": [
                      "Copies the input vector and raw GGML Q8_0 rows into the shared input page, records PM4 for one serial workitem over `rows`, and reads back one f32 result per row. This keeps source-format Q8_0 model-slice validation exact while the final K-parallel DMMV kernel is still under construction."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_q8_0",
                        "description": "Row-major GGML Q8_0 row bytes; must hold at least `rows * (cols/32*34)` bytes."
                      },
                      {
                        "name": "rows",
                        "description": "Number of output rows to compute."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving `rows` f32 values."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the gfx1201 row-range Q8_0 matrix-vector kernel.\n\nCopies the input vector and raw GGML Q8_0 rows into the shared input\npage, records PM4 for one serial workitem over `rows`, and reads back one\nf32 result per row. This keeps source-format Q8_0 model-slice validation\nexact while the final K-parallel DMMV kernel is still under construction."
                  }
                },
                {
                  "name": "dmmvQ8_0TwoRowRanges",
                  "qualified_name": "TokenBoundary.dmmvQ8_0TwoRowRanges",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ8_0TwoRowRanges( self: *TokenBoundary, input: []const f32, weights_a_q8_0: []const u8, rows_a: u32, weights_b_q8_0: []const u8, rows_b: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q8-0-two-row-ranges",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q8-0-two-row-ranges",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 3248,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3248",
                  "doc": {
                    "summary": "Dispatch one gfx1201 Q8_0 DMMV kernel over two adjacent logical row ranges that share the same input vector.",
                    "description": [
                      "The method packs `weights_a` followed by `weights_b` into the staging page, then runs the same compact Q8_0 row-range kernel over `rows_a + rows_b` rows. The output slice receives A's rows first and B's rows second. This is used by the M1 bridge to consume paired SSM alpha/beta projections without paying two CS submissions for the same activation vector."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_a_q8_0",
                        "description": "Row-major GGML Q8_0 bytes for range A; must hold at least `rows_a * (cols/32*34)` bytes."
                      },
                      {
                        "name": "rows_a",
                        "description": "Number of rows in the A range."
                      },
                      {
                        "name": "weights_b_q8_0",
                        "description": "Row-major GGML Q8_0 bytes for range B; must hold at least `rows_b * (cols/32*34)` bytes."
                      },
                      {
                        "name": "rows_b",
                        "description": "Number of rows in the B range."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving `rows_a + rows_b` f32 values: A rows first, then B rows."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Returns `error.SignalMismatch` if the post-fence signal sentinel does not match."
                    ],
                    "raw": "Dispatch one gfx1201 Q8_0 DMMV kernel over two adjacent logical row\nranges that share the same input vector.\n\nThe method packs `weights_a` followed by `weights_b` into the staging\npage, then runs the same compact Q8_0 row-range kernel over\n`rows_a + rows_b` rows. The output slice receives A's rows first and B's\nrows second. This is used by the M1 bridge to consume paired SSM\nalpha/beta projections without paying two CS submissions for the same\nactivation vector."
                  }
                },
                {
                  "name": "dmmvQ8_0TwoRowRangesParallel64",
                  "qualified_name": "TokenBoundary.dmmvQ8_0TwoRowRangesParallel64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dmmvQ8_0TwoRowRangesParallel64( self: *TokenBoundary, input: []const f32, weights_a_q8_0: []const u8, rows_a: u32, weights_b_q8_0: []const u8, rows_b: u32, cols: u32, output: []f32, ) !void",
                  "anchor": "token-boundary-dmmv-q8-0-two-row-ranges-parallel64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#token-boundary-dmmv-q8-0-two-row-ranges-parallel64",
                  "source_path": "src/zinc_rt/ring/cs.zig",
                  "source_line": 3275,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3275",
                  "doc": {
                    "summary": "Dispatch one wave64 Q8_0 DMMV kernel over two packed row ranges totalling exactly 64 rows.",
                    "description": [
                      "This is the row-parallel companion to `dmmvQ8_0TwoRowRanges` for the current SSM alpha+beta shape: 32 alpha rows plus 32 beta rows. Each lane computes one row from the packed staging block, eliminating the serial per-row loop of the scalar variant."
                    ],
                    "params": [
                      {
                        "name": "input",
                        "description": "Input activation vector of length `cols`."
                      },
                      {
                        "name": "weights_a_q8_0",
                        "description": "Row-major GGML Q8_0 bytes for range A; must hold at least `rows_a * (cols/32*34)` bytes."
                      },
                      {
                        "name": "rows_a",
                        "description": "Number of rows in the A range; `rows_a + rows_b` must equal 64."
                      },
                      {
                        "name": "weights_b_q8_0",
                        "description": "Row-major GGML Q8_0 bytes for range B; must hold at least `rows_b * (cols/32*34)` bytes."
                      },
                      {
                        "name": "rows_b",
                        "description": "Number of rows in the B range."
                      },
                      {
                        "name": "cols",
                        "description": "Inner dimension; must be a multiple of 32."
                      },
                      {
                        "name": "output",
                        "description": "Output slice receiving exactly 64 f32 values: A rows first, then B rows."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Returns `error.ShapeMismatch` if `rows_a + rows_b != 64`. Returns `error.SignalMismatch` on sentinel mismatch."
                    ],
                    "raw": "Dispatch one wave64 Q8_0 DMMV kernel over two packed row ranges totalling exactly 64 rows.\n\nThis is the row-parallel companion to `dmmvQ8_0TwoRowRanges` for the\ncurrent SSM alpha+beta shape: 32 alpha rows plus 32 beta rows. Each lane\ncomputes one row from the packed staging block, eliminating the serial\nper-row loop of the scalar variant."
                  }
                }
              ]
            },
            {
              "name": "lastErrno",
              "qualified_name": "lastErrno",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn lastErrno() ?linux.E",
              "anchor": "last-errno",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#last-errno",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 3424,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3424",
              "doc": {
                "summary": "Errno captured from the most recent `ioctl` issued by this module, or null if the call succeeded.",
                "description": [
                  "Useful for surfacing a precise reason after a `SmokeResult.status` indicates a kernel-side failure."
                ],
                "params": [],
                "returns": "The latest captured `linux.E` value, or null when there was no error.",
                "notes": [],
                "raw": "Errno captured from the most recent `ioctl` issued by this module, or null\nif the call succeeded. Useful for surfacing a precise reason after a\n`SmokeResult.status` indicates a kernel-side failure."
              },
              "members": []
            },
            {
              "name": "setupSmokeDefault",
              "qualified_name": "setupSmokeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn setupSmokeDefault() SmokeResult",
              "anchor": "setup-smoke-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#setup-smoke-default",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 3430,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3430",
              "doc": {
                "summary": "Run the bring-up smoke gate against `default_render_node`.",
                "description": [],
                "params": [],
                "returns": "A `SmokeResult` summarizing whether the two PM4 submissions retired and the signal sentinel matched.",
                "notes": [],
                "raw": "Run the bring-up smoke gate against `default_render_node`."
              },
              "members": []
            },
            {
              "name": "setupSmokePath",
              "qualified_name": "setupSmokePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn setupSmokePath(render_node: []const u8) SmokeResult",
              "anchor": "setup-smoke-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#setup-smoke-path",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 3437,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3437",
              "doc": {
                "summary": "Run the bring-up smoke gate against the given DRM render node path.",
                "description": [],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Absolute path to the amdgpu DRM render node to test."
                  }
                ],
                "returns": "A `SmokeResult` describing the open → submit → wait outcome.",
                "notes": [],
                "raw": "Run the bring-up smoke gate against the given DRM render node path."
              },
              "members": []
            },
            {
              "name": "submitNopSmokeDefault",
              "qualified_name": "submitNopSmokeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn submitNopSmokeDefault() SmokeResult",
              "anchor": "submit-nop-smoke-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#submit-nop-smoke-default",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 3444,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3444",
              "doc": {
                "summary": "Backwards-compatible alias for `setupSmokeDefault` named for the underlying PM4 NOP+WRITE_DATA stream that exercises the CS path.",
                "description": [],
                "params": [],
                "returns": "A `SmokeResult` describing the bring-up outcome on `default_render_node`.",
                "notes": [],
                "raw": "Backwards-compatible alias for `setupSmokeDefault` named for the underlying\nPM4 NOP+WRITE_DATA stream that exercises the CS path."
              },
              "members": []
            },
            {
              "name": "submitNopSmokePath",
              "qualified_name": "submitNopSmokePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn submitNopSmokePath(render_node: []const u8) SmokeResult",
              "anchor": "submit-nop-smoke-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cs/#submit-nop-smoke-path",
              "source_path": "src/zinc_rt/ring/cs.zig",
              "source_line": 3456,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/cs.zig#L3456",
              "doc": {
                "summary": "Full bring-up smoke implementation: open the render node, query compute IP, allocate a context, create GTT-backed IB + signal BOs and map them at fixed low GPU VAs, build a PM4 NOP + `WRITE_DATA` stream, submit it twice through `DRM_IOCTL_AMDGPU_CS`, and verify each fence retires with the expected signal sentinel in the signal BO.",
                "description": [],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Absolute path to the amdgpu DRM render node to exercise."
                  }
                ],
                "returns": "A `SmokeResult` whose `status` pinpoints the failure stage, or `.ok` on success.",
                "notes": [
                  "Returns `.unsupported_os` immediately on non-Linux hosts; never throws."
                ],
                "raw": "Full bring-up smoke implementation: open the render node, query compute IP,\nallocate a context, create GTT-backed IB + signal BOs and map them at fixed\nlow GPU VAs, build a PM4 NOP + `WRITE_DATA` stream, submit it twice through\n`DRM_IOCTL_AMDGPU_CS`, and verify each fence retires with the expected\nsignal sentinel in the signal BO."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "kfd",
          "title": "Kfd",
          "section": "Inference Runtime",
          "summary": "AMDGPU KFD (`/dev/kfd`) bring-up for the T1 PM4-direct tier.",
          "overview": [
            "The design's T1 tier submits PM4 packets straight to the AMD command processor. On Linux that means the KFD compute path (`/dev/kfd` + `AMDKFD_IOC_*`), the same userspace ABI ROCm/HSA and tinygrad ride on. It works on every `amdgpu` kernel that ships KFD and does not depend on the experimental user-mode-queue (UMQ / `DRM_IOCTL_AMDGPU_USERQ`) ABI, which on the R9700 (gfx1201, kernel 6.17, `uni_mes` firmware) the kernel rejects with \"Usermode queue is not supported for this IP\" — see `umq.zig` and §14 of the design doc.",
            "This module brings up the T1 PM4-direct path on the kernel ABI that works: * open `/dev/kfd` + the render node, `AMDKFD_IOC_GET_VERSION`, * match the render minor against `/sys/.../kfd/topology/nodes/*`, * `AMDKFD_IOC_ACQUIRE_VM`, `AMDKFD_IOC_GET_PROCESS_APERTURES_NEW`, * `bringUpPath`: reserve a VA window inside the GPUVM aperture, `ALLOC_MEMORY_OF_GPU` (GTT, writable) + `mmap` + `MAP_MEMORY_TO_GPU` + a CPU round-trip, then `UNMAP_MEMORY_FROM_GPU` + `FREE_MEMORY_OF_GPU`, * `createComputeQueueSmokePath`: allocate the ring / wptr / rptr / EOP / CWSR buffer objects the way `kfd_queue_acquire_buffers` validates them, `AMDKFD_IOC_CREATE_QUEUE` (PM4 compute), stage a couple of PM4 NOP packets into the ring, then `AMDKFD_IOC_DESTROY_QUEUE` and tear down. Ringing the doorbell and retiring a PM4 fence is the next bring-up step."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/",
          "source_path": "src/zinc_rt/ring/kfd.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L33",
          "counts": {
            "code_lines": 731,
            "exports": 40,
            "methods": 2,
            "symbols": 42
          },
          "symbols": [
            {
              "name": "default_render_node",
              "qualified_name": "default_render_node",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const default_render_node = \"/dev/dri/renderD128\"",
              "anchor": "default-render-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#default-render-node",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 33,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L33",
              "doc": {
                "summary": "Default DRM render node used when the caller does not supply one.",
                "description": [
                  "The renderD128 minor is the standard single-GPU choice on AMD Linux systems."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Default DRM render node used when the caller does not supply one. The\nrenderD128 minor is the standard single-GPU choice on AMD Linux systems."
              },
              "members": []
            },
            {
              "name": "kfd_device_node",
              "qualified_name": "kfd_device_node",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const kfd_device_node = \"/dev/kfd\"",
              "anchor": "kfd-device-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#kfd-device-node",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 35,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L35",
              "doc": {
                "summary": "Path to the KFD compute device used for every AMDKFD_IOC_* ioctl.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Path to the KFD compute device used for every AMDKFD_IOC_* ioctl."
              },
              "members": []
            },
            {
              "name": "topology_nodes_dir",
              "qualified_name": "topology_nodes_dir",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const topology_nodes_dir = \"/sys/devices/virtual/kfd/kfd/topology/nodes\"",
              "anchor": "topology-nodes-dir",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#topology-nodes-dir",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L38",
              "doc": {
                "summary": "Sysfs root that enumerates KFD topology nodes (one subdirectory per node, each carrying `gpu_id` and a `properties` file that drives queue sizing).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Sysfs root that enumerates KFD topology nodes (one subdirectory per node,\neach carrying `gpu_id` and a `properties` file that drives queue sizing)."
              },
              "members": []
            },
            {
              "name": "min_kfd_major",
              "qualified_name": "min_kfd_major",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const min_kfd_major: u32 = 1",
              "anchor": "min-kfd-major",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#min-kfd-major",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 41,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L41",
              "doc": {
                "summary": "Minimum KFD ABI major version required for the PM4 compute path; the bring-up fails fast with `kfd_version_too_old` below this number.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Minimum KFD ABI major version required for the PM4 compute path; the\nbring-up fails fast with `kfd_version_too_old` below this number."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_VRAM",
              "qualified_name": "ALLOC_MEM_FLAGS_VRAM",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_VRAM: u32 = 1 << 0",
              "anchor": "alloc-mem-flags-vram",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-vram",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 58,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L58",
              "doc": {
                "summary": "Allocate the BO out of device VRAM (local frame buffer).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate the BO out of device VRAM (local frame buffer)."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_GTT",
              "qualified_name": "ALLOC_MEM_FLAGS_GTT",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_GTT: u32 = 1 << 1",
              "anchor": "alloc-mem-flags-gtt",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-gtt",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 60,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L60",
              "doc": {
                "summary": "Allocate the BO out of system GTT memory (the path used by every smoke BO).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate the BO out of system GTT memory (the path used by every smoke BO)."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_USERPTR",
              "qualified_name": "ALLOC_MEM_FLAGS_USERPTR",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_USERPTR: u32 = 1 << 2",
              "anchor": "alloc-mem-flags-userptr",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-userptr",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 62,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L62",
              "doc": {
                "summary": "Pin a userptr range as the BO backing; not used by the bring-up smoke path.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Pin a userptr range as the BO backing; not used by the bring-up smoke path."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_DOORBELL",
              "qualified_name": "ALLOC_MEM_FLAGS_DOORBELL",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_DOORBELL: u32 = 1 << 3",
              "anchor": "alloc-mem-flags-doorbell",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-doorbell",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 64,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L64",
              "doc": {
                "summary": "Allocate a doorbell page so a userspace queue can ring its wptr doorbell.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate a doorbell page so a userspace queue can ring its wptr doorbell."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_COHERENT",
              "qualified_name": "ALLOC_MEM_FLAGS_COHERENT",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_COHERENT: u32 = 1 << 26",
              "anchor": "alloc-mem-flags-coherent",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-coherent",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 66,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L66",
              "doc": {
                "summary": "Request a CPU-coherent BO (snooped on x86); not used by the bring-up smoke path.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Request a CPU-coherent BO (snooped on x86); not used by the bring-up smoke path."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_PUBLIC",
              "qualified_name": "ALLOC_MEM_FLAGS_PUBLIC",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_PUBLIC: u32 = 1 << 29",
              "anchor": "alloc-mem-flags-public",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-public",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 68,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L68",
              "doc": {
                "summary": "Mark the BO as PCIe-visible / exportable to peer devices.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Mark the BO as PCIe-visible / exportable to peer devices."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_EXECUTABLE",
              "qualified_name": "ALLOC_MEM_FLAGS_EXECUTABLE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_EXECUTABLE: u32 = 1 << 30",
              "anchor": "alloc-mem-flags-executable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-executable",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 70,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L70",
              "doc": {
                "summary": "Mark the BO as containing GPU-executable code (shader binaries).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Mark the BO as containing GPU-executable code (shader binaries)."
              },
              "members": []
            },
            {
              "name": "ALLOC_MEM_FLAGS_WRITABLE",
              "qualified_name": "ALLOC_MEM_FLAGS_WRITABLE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ALLOC_MEM_FLAGS_WRITABLE: u32 = 1 << 31",
              "anchor": "alloc-mem-flags-writable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-mem-flags-writable",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 72,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L72",
              "doc": {
                "summary": "Map the BO with write permission on the GPU side (default for smoke BOs).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Map the BO with write permission on the GPU side (default for smoke BOs)."
              },
              "members": []
            },
            {
              "name": "QUEUE_TYPE_COMPUTE",
              "qualified_name": "QUEUE_TYPE_COMPUTE",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const QUEUE_TYPE_COMPUTE: u32 = 0x0",
              "anchor": "queue-type-compute",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#queue-type-compute",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 76,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L76",
              "doc": {
                "summary": "PM4 compute queue type passed to `AMDKFD_IOC_CREATE_QUEUE` for MEC pipes.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "PM4 compute queue type passed to `AMDKFD_IOC_CREATE_QUEUE` for MEC pipes."
              },
              "members": []
            },
            {
              "name": "QUEUE_TYPE_SDMA",
              "qualified_name": "QUEUE_TYPE_SDMA",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const QUEUE_TYPE_SDMA: u32 = 0x1",
              "anchor": "queue-type-sdma",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#queue-type-sdma",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 78,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L78",
              "doc": {
                "summary": "SDMA queue type; copy engine queue, not used by the PM4 compute bring-up.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SDMA queue type; copy engine queue, not used by the PM4 compute bring-up."
              },
              "members": []
            },
            {
              "name": "QUEUE_TYPE_COMPUTE_AQL",
              "qualified_name": "QUEUE_TYPE_COMPUTE_AQL",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const QUEUE_TYPE_COMPUTE_AQL: u32 = 0x2",
              "anchor": "queue-type-compute-aql",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#queue-type-compute-aql",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 80,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L80",
              "doc": {
                "summary": "AQL compute queue type (HSA packet processor format) used by ROCm/HSA.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "AQL compute queue type (HSA packet processor format) used by ROCm/HSA."
              },
              "members": []
            },
            {
              "name": "GetVersionArgs",
              "qualified_name": "GetVersionArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GetVersionArgs = extern struct",
              "anchor": "get-version-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#get-version-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 84,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L84",
              "doc": {
                "summary": "`AMDKFD_IOC_GET_VERSION` ioctl args — the KFD ABI version reported by the running kernel.",
                "description": [
                  "Matches `struct kfd_ioctl_get_version_args` from uapi."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_GET_VERSION` ioctl args — the KFD ABI version reported by the\nrunning kernel. Matches `struct kfd_ioctl_get_version_args` from uapi."
              },
              "members": []
            },
            {
              "name": "AcquireVmArgs",
              "qualified_name": "AcquireVmArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const AcquireVmArgs = extern struct",
              "anchor": "acquire-vm-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#acquire-vm-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 92,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L92",
              "doc": {
                "summary": "`AMDKFD_IOC_ACQUIRE_VM` ioctl args — binds the calling process's GPUVM to the DRM render node fd so subsequent allocations land in the right address space.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_ACQUIRE_VM` ioctl args — binds the calling process's GPUVM to\nthe DRM render node fd so subsequent allocations land in the right address\nspace."
              },
              "members": []
            },
            {
              "name": "ProcessDeviceApertures",
              "qualified_name": "ProcessDeviceApertures",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ProcessDeviceApertures = extern struct",
              "anchor": "process-device-apertures",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#process-device-apertures",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 100,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L100",
              "doc": {
                "summary": "One device aperture entry returned by `GET_PROCESS_APERTURES_NEW`: the LDS, scratch, and GPUVM windows that this process is allowed to use on the indicated `gpu_id`.",
                "description": [
                  "The bring-up only consumes `gpuvm_base/limit`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One device aperture entry returned by `GET_PROCESS_APERTURES_NEW`: the LDS,\nscratch, and GPUVM windows that this process is allowed to use on the\nindicated `gpu_id`. The bring-up only consumes `gpuvm_base/limit`."
              },
              "members": []
            },
            {
              "name": "GetProcessAperturesNewArgs",
              "qualified_name": "GetProcessAperturesNewArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GetProcessAperturesNewArgs = extern struct",
              "anchor": "get-process-apertures-new-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#get-process-apertures-new-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 114,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L114",
              "doc": {
                "summary": "`AMDKFD_IOC_GET_PROCESS_APERTURES_NEW` ioctl args — caller supplies a pointer to an array of `ProcessDeviceApertures` plus its length; the kernel fills the array and updates `num_of_nodes` with the actual count.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_GET_PROCESS_APERTURES_NEW` ioctl args — caller supplies a\npointer to an array of `ProcessDeviceApertures` plus its length; the kernel\nfills the array and updates `num_of_nodes` with the actual count."
              },
              "members": []
            },
            {
              "name": "AllocMemoryOfGpuArgs",
              "qualified_name": "AllocMemoryOfGpuArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const AllocMemoryOfGpuArgs = extern struct",
              "anchor": "alloc-memory-of-gpu-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#alloc-memory-of-gpu-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 123,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L123",
              "doc": {
                "summary": "`AMDKFD_IOC_ALLOC_MEMORY_OF_GPU` ioctl args.",
                "description": [
                  "The caller chooses the GPU VA (`va_addr`) and the kernel returns a BO `handle` plus an `mmap_offset` for the DRM render node so the BO can be CPU-mapped."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_ALLOC_MEMORY_OF_GPU` ioctl args. The caller chooses the GPU VA\n(`va_addr`) and the kernel returns a BO `handle` plus an `mmap_offset` for\nthe DRM render node so the BO can be CPU-mapped."
              },
              "members": []
            },
            {
              "name": "FreeMemoryOfGpuArgs",
              "qualified_name": "FreeMemoryOfGpuArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FreeMemoryOfGpuArgs = extern struct",
              "anchor": "free-memory-of-gpu-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#free-memory-of-gpu-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 134,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L134",
              "doc": {
                "summary": "`AMDKFD_IOC_FREE_MEMORY_OF_GPU` ioctl args — release the BO referenced by `handle` (must already be unmapped from every GPU it was mapped to).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_FREE_MEMORY_OF_GPU` ioctl args — release the BO referenced by\n`handle` (must already be unmapped from every GPU it was mapped to)."
              },
              "members": []
            },
            {
              "name": "MapMemoryToGpuArgs",
              "qualified_name": "MapMemoryToGpuArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MapMemoryToGpuArgs = extern struct",
              "anchor": "map-memory-to-gpu-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#map-memory-to-gpu-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 141,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L141",
              "doc": {
                "summary": "`AMDKFD_IOC_MAP_MEMORY_TO_GPU` / `UNMAP_MEMORY_FROM_GPU` ioctl args.",
                "description": [
                  "Same layout for both directions; the kernel updates `n_success` with the number of devices the BO was successfully (un)mapped on."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_MAP_MEMORY_TO_GPU` / `UNMAP_MEMORY_FROM_GPU` ioctl args. Same\nlayout for both directions; the kernel updates `n_success` with the number\nof devices the BO was successfully (un)mapped on."
              },
              "members": []
            },
            {
              "name": "CreateQueueArgs",
              "qualified_name": "CreateQueueArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CreateQueueArgs = extern struct",
              "anchor": "create-queue-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#create-queue-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 151,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L151",
              "doc": {
                "summary": "`AMDKFD_IOC_CREATE_QUEUE` ioctl args — describes the PM4 compute queue the kernel should map onto the MEC.",
                "description": [
                  "Every BO address (ring/wptr/rptr/EOP/CWSR) must already be allocated and mapped to the same GPU before the ioctl."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_CREATE_QUEUE` ioctl args — describes the PM4 compute queue the\nkernel should map onto the MEC. Every BO address (ring/wptr/rptr/EOP/CWSR)\nmust already be allocated and mapped to the same GPU before the ioctl."
              },
              "members": []
            },
            {
              "name": "DestroyQueueArgs",
              "qualified_name": "DestroyQueueArgs",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DestroyQueueArgs = extern struct",
              "anchor": "destroy-queue-args",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#destroy-queue-args",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 171,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L171",
              "doc": {
                "summary": "`AMDKFD_IOC_DESTROY_QUEUE` ioctl args — release the queue identified by `queue_id` (the value the kernel returned from `CREATE_QUEUE`).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "`AMDKFD_IOC_DESTROY_QUEUE` ioctl args — release the queue identified by\n`queue_id` (the value the kernel returned from `CREATE_QUEUE`)."
              },
              "members": []
            },
            {
              "name": "TopologyNode",
              "qualified_name": "TopologyNode",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const TopologyNode = struct",
              "anchor": "topology-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#topology-node",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 190,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L190",
              "doc": {
                "summary": "One GPU topology node parsed from `topology_nodes_dir`.",
                "description": [
                  "Carries the values the queue bring-up needs to validate `CREATE_QUEUE`: `gpu_id`, the GFX IP target version, CU/SIMD counts that drive CWSR sizing, and the canonical `cwsr_size` / `ctl_stack_size` advertised by the kernel."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One GPU topology node parsed from `topology_nodes_dir`. Carries the values\nthe queue bring-up needs to validate `CREATE_QUEUE`: `gpu_id`, the GFX IP\ntarget version, CU/SIMD counts that drive CWSR sizing, and the canonical\n`cwsr_size` / `ctl_stack_size` advertised by the kernel."
              },
              "members": []
            },
            {
              "name": "BringUpStatus",
              "qualified_name": "BringUpStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const BringUpStatus = enum",
              "anchor": "bring-up-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#bring-up-status",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 205,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L205",
              "doc": {
                "summary": "Outcome categories for `bringUpPath`.",
                "description": [
                  "Every non-`ok` value identifies the exact bring-up step that failed (open, version check, aperture lookup, VA reservation, alloc, map, mmap, CPU round-trip, unmap, free)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome categories for `bringUpPath`. Every non-`ok` value identifies the\nexact bring-up step that failed (open, version check, aperture lookup, VA\nreservation, alloc, map, mmap, CPU round-trip, unmap, free)."
              },
              "members": []
            },
            {
              "name": "BringUpResult",
              "qualified_name": "BringUpResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BringUpResult = struct",
              "anchor": "bring-up-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#bring-up-result",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 232,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L232",
              "doc": {
                "summary": "Full bring-up report produced by `bringUpPath`.",
                "description": [
                  "Captures the status plus every observable value the smoke run collected (KFD ABI version, topology info, the GPUVM window, the reserved VA, and the errno of the last failing ioctl when applicable) so callers can render diagnostics without rerunning."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Full bring-up report produced by `bringUpPath`. Captures the status plus\nevery observable value the smoke run collected (KFD ABI version, topology\ninfo, the GPUVM window, the reserved VA, and the errno of the last failing\nioctl when applicable) so callers can render diagnostics without rerunning."
              },
              "members": [
                {
                  "name": "ok",
                  "qualified_name": "BringUpResult.ok",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ok(self: BringUpResult) bool",
                  "anchor": "bring-up-result-ok",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#bring-up-result-ok",
                  "source_path": "src/zinc_rt/ring/kfd.zig",
                  "source_line": 248,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L248",
                  "doc": {
                    "summary": "True when every bring-up step succeeded (`status == .ok`).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "True when every bring-up step succeeded (`status == .ok`)."
                  }
                }
              ]
            },
            {
              "name": "lastErrno",
              "qualified_name": "lastErrno",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn lastErrno() ?linux.E",
              "anchor": "last-errno",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#last-errno",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 257,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L257",
              "doc": {
                "summary": "Returns the errno of the most recent failing ioctl, or `null` if the last ioctl succeeded.",
                "description": [
                  "Cleared at the start of each `ioctlChecked` call."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Returns the errno of the most recent failing ioctl, or `null` if the last\nioctl succeeded. Cleared at the start of each `ioctlChecked` call."
              },
              "members": []
            },
            {
              "name": "renderMinorOf",
              "qualified_name": "renderMinorOf",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn renderMinorOf(render_node: []const u8) ?u32",
              "anchor": "render-minor-of",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#render-minor-of",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 277,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L277",
              "doc": {
                "summary": "Extract the DRM render minor number from a `/dev/dri/renderD<N>` path.",
                "description": [
                  "contain a recognizable `renderD<digits>` suffix."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Absolute path to the DRM render node (e.g. `/dev/dri/renderD128`)."
                  }
                ],
                "returns": "The parsed minor number (e.g. 128), or `null` if the path does not",
                "notes": [],
                "raw": "Extract the DRM render minor number from a `/dev/dri/renderD<N>` path.\ncontain a recognizable `renderD<digits>` suffix."
              },
              "members": []
            },
            {
              "name": "findTopologyNode",
              "qualified_name": "findTopologyNode",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn findTopologyNode(render_minor: u32) ?TopologyNode",
              "anchor": "find-topology-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#find-topology-node",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 316,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L316",
              "doc": {
                "summary": "Scan `topology_nodes_dir` for the GPU topology node whose `drm_render_minor` matches the given render minor, parsing `gpu_id`, `gfx_target_version`, `simd_count`, `cwsr_size`, and related properties from each node's `properties` file.",
                "description": [
                  "CPU-only nodes (gpu_id == 0) are skipped. the sysfs directory cannot be opened."
                ],
                "params": [
                  {
                    "name": "render_minor",
                    "description": "DRM render minor to match (e.g. 128 for `renderD128`)."
                  }
                ],
                "returns": "The matching `TopologyNode`, or `null` if no GPU node matches or if",
                "notes": [
                  "Always returns `null` on non-Linux targets."
                ],
                "raw": "Scan `topology_nodes_dir` for the GPU topology node whose `drm_render_minor`\nmatches the given render minor, parsing `gpu_id`, `gfx_target_version`,\n`simd_count`, `cwsr_size`, and related properties from each node's `properties`\nfile. CPU-only nodes (gpu_id == 0) are skipped.\nthe sysfs directory cannot be opened."
              },
              "members": []
            },
            {
              "name": "reachable",
              "qualified_name": "reachable",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn reachable() bool",
              "anchor": "reachable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#reachable",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 354,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L354",
              "doc": {
                "summary": "Cheaply test whether the KFD PM4 path appears usable on this machine without issuing any ioctls: opens `/dev/kfd`, then verifies that a matching topology node with a non-zero `gpu_id` exists in sysfs for the default render minor.",
                "description": [
                  "found for the default render node; `false` otherwise or on non-Linux targets."
                ],
                "params": [],
                "returns": "`true` when `/dev/kfd` is accessible and a valid topology node is",
                "notes": [],
                "raw": "Cheaply test whether the KFD PM4 path appears usable on this machine without\nissuing any ioctls: opens `/dev/kfd`, then verifies that a matching topology\nnode with a non-zero `gpu_id` exists in sysfs for the default render minor.\nfound for the default render node; `false` otherwise or on non-Linux targets."
              },
              "members": []
            },
            {
              "name": "bringUpDefault",
              "qualified_name": "bringUpDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn bringUpDefault() BringUpResult",
              "anchor": "bring-up-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#bring-up-default",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 365,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L365",
              "doc": {
                "summary": "Run `bringUpPath` against `default_render_node` (\"/dev/dri/renderD128\").",
                "description": [],
                "params": [],
                "returns": "Status + diagnostics for the GPUVM round-trip.",
                "notes": [],
                "raw": "Run `bringUpPath` against `default_render_node` (\"/dev/dri/renderD128\")."
              },
              "members": []
            },
            {
              "name": "bringUpPath",
              "qualified_name": "bringUpPath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn bringUpPath(render_node: []const u8) BringUpResult",
              "anchor": "bring-up-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#bring-up-path",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 381,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L381",
              "doc": {
                "summary": "End-to-end KFD bring-up: open `/dev/kfd` and the supplied render node, check the ABI version, acquire the GPUVM, look up the matching topology aperture, reserve a 64 KiB VA window inside it, allocate + mmap + MAP_MEMORY_TO_GPU a 4 KiB GTT scratch BO, write/read a magic value to verify the round-trip, then unmap and free everything.",
                "description": [
                  "Every failure point is captured in the returned `BringUpResult` (status + last errno) so a non-Linux caller or a partial-permissions environment can still get a useful diagnostic without panicking. round-trip."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Path to the DRM render node (e.g. `/dev/dri/renderD128`)."
                  }
                ],
                "returns": "A populated `BringUpResult`; `.ok()` is true only on a clean",
                "notes": [
                  "Off Linux this short-circuits to `unsupported_os` and performs no IO."
                ],
                "raw": "End-to-end KFD bring-up: open `/dev/kfd` and the supplied render node,\ncheck the ABI version, acquire the GPUVM, look up the matching topology\naperture, reserve a 64 KiB VA window inside it, allocate + mmap +\nMAP_MEMORY_TO_GPU a 4 KiB GTT scratch BO, write/read a magic value to\nverify the round-trip, then unmap and free everything. Every failure point\nis captured in the returned `BringUpResult` (status + last errno) so a\nnon-Linux caller or a partial-permissions environment can still get a\nuseful diagnostic without panicking.\nround-trip."
              },
              "members": []
            },
            {
              "name": "ComputeQueueSmokeStatus",
              "qualified_name": "ComputeQueueSmokeStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const ComputeQueueSmokeStatus = enum",
              "anchor": "compute-queue-smoke-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#compute-queue-smoke-status",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 551,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L551",
              "doc": {
                "summary": "Outcome categories for the PM4 compute-queue smoke path.",
                "description": [
                  "Each non-`ok` value identifies a specific failure step (BO allocation, map, `CREATE_QUEUE`, `DESTROY_QUEUE`) so callers can render bring-up reports."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome categories for the PM4 compute-queue smoke path. Each non-`ok`\nvalue identifies a specific failure step (BO allocation, map,\n`CREATE_QUEUE`, `DESTROY_QUEUE`) so callers can render bring-up reports."
              },
              "members": []
            },
            {
              "name": "ComputeQueueSmokeResult",
              "qualified_name": "ComputeQueueSmokeResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ComputeQueueSmokeResult = struct",
              "anchor": "compute-queue-smoke-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#compute-queue-smoke-result",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 573,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L573",
              "doc": {
                "summary": "Full report for the PM4 compute-queue smoke run.",
                "description": [
                  "Captures the status plus every observable value the run produced (BO VAs, queue id, doorbell offset, initial wptr/rptr, number of PM4 NOP dwords staged, and the errno of the last failing ioctl) so a higher-level CLI can render bring-up output."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Full report for the PM4 compute-queue smoke run. Captures the status plus\nevery observable value the run produced (BO VAs, queue id, doorbell offset,\ninitial wptr/rptr, number of PM4 NOP dwords staged, and the errno of the\nlast failing ioctl) so a higher-level CLI can render bring-up output."
              },
              "members": [
                {
                  "name": "ok",
                  "qualified_name": "ComputeQueueSmokeResult.ok",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ok(self: ComputeQueueSmokeResult) bool",
                  "anchor": "compute-queue-smoke-result-ok",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#compute-queue-smoke-result-ok",
                  "source_path": "src/zinc_rt/ring/kfd.zig",
                  "source_line": 599,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L599",
                  "doc": {
                    "summary": "True when the queue was created, NOPs staged, and the queue destroyed without any ioctl failure.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "True when the queue was created, NOPs staged, and the queue destroyed\nwithout any ioctl failure."
                  }
                }
              ]
            },
            {
              "name": "alignUp",
              "qualified_name": "alignUp",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn alignUp(value: u64, alignment: u64) u64",
              "anchor": "align-up",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#align-up",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 612,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L612",
              "doc": {
                "summary": "Round `value` up to the next multiple of `alignment`.",
                "description": [
                  "Returns `value` unchanged when `alignment` is zero or `value` is already aligned."
                ],
                "params": [
                  {
                    "name": "value",
                    "description": "Number to be rounded up."
                  },
                  {
                    "name": "alignment",
                    "description": "Power-of-two (or any non-zero) boundary to align to."
                  }
                ],
                "returns": "Smallest multiple of `alignment` that is `>= value`.",
                "notes": [],
                "raw": "Round `value` up to the next multiple of `alignment`. Returns `value`\nunchanged when `alignment` is zero or `value` is already aligned."
              },
              "members": []
            },
            {
              "name": "computeCwsrBoSize",
              "qualified_name": "computeCwsrBoSize",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn computeCwsrBoSize( cwsr_size: u32, simd_count: u32, simd_per_cu_in: u32, num_xcc_in: u32, gfx_target_version: u32, ) u64",
              "anchor": "compute-cwsr-bo-size",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#compute-cwsr-bo-size",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 632,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L632",
              "doc": {
                "summary": "Compute the CWSR buffer-object size that the kernel's `kfd_queue_acquire_buffers` will accept for a given GPU topology.",
                "description": [
                  "The formula is `align_up((cwsr_size + debug_memory_size) * num_xcc, PAGE)`, where for gfx ≥ 10.1.x `debug_memory_size = align_up((simd_count / simd_per_cu / num_xcc) * 32 * 32, 64)` and for older IPs `debug_memory_size = 0`. Verified on the R9700 (gfx1201): cwsr_size 0x1d47000, debug 0x10000, resulting BO 0x1d57000. (2 for RDNA, 4 for GCN/CDNA)."
                ],
                "params": [
                  {
                    "name": "cwsr_size",
                    "description": "Raw `cwsr_size` from the topology `properties` file (bytes)."
                  },
                  {
                    "name": "simd_count",
                    "description": "Total SIMD units across all XCCs for this GPU."
                  },
                  {
                    "name": "simd_per_cu_in",
                    "description": "SIMD units per CU; if 0, derived from `gfx_target_version`"
                  },
                  {
                    "name": "num_xcc_in",
                    "description": "Number of XCC dies; treated as 1 if 0."
                  },
                  {
                    "name": "gfx_target_version",
                    "description": "Encoded GFX IP version (major×10000 + minor×100 + step)."
                  }
                ],
                "returns": "Total BO allocation size in bytes, page-aligned.",
                "notes": [],
                "raw": "Compute the CWSR buffer-object size that the kernel's `kfd_queue_acquire_buffers`\nwill accept for a given GPU topology. The formula is\n`align_up((cwsr_size + debug_memory_size) * num_xcc, PAGE)`, where for\ngfx ≥ 10.1.x `debug_memory_size = align_up((simd_count / simd_per_cu /\nnum_xcc) * 32 * 32, 64)` and for older IPs `debug_memory_size = 0`.\nVerified on the R9700 (gfx1201): cwsr_size 0x1d47000, debug 0x10000,\nresulting BO 0x1d57000.\n(2 for RDNA, 4 for GCN/CDNA)."
              },
              "members": []
            },
            {
              "name": "createComputeQueueSmokeDefault",
              "qualified_name": "createComputeQueueSmokeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createComputeQueueSmokeDefault() ComputeQueueSmokeResult",
              "anchor": "create-compute-queue-smoke-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#create-compute-queue-smoke-default",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 765,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L765",
              "doc": {
                "summary": "Run `createComputeQueueSmokePath` against `default_render_node`.",
                "description": [],
                "params": [],
                "returns": "The compute-queue smoke result; `.ok()` is true on a clean run.",
                "notes": [],
                "raw": "Run `createComputeQueueSmokePath` against `default_render_node`."
              },
              "members": []
            },
            {
              "name": "createComputeQueueSmokePath",
              "qualified_name": "createComputeQueueSmokePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createComputeQueueSmokePath(render_node: []const u8) ComputeQueueSmokeResult",
              "anchor": "create-compute-queue-smoke-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#create-compute-queue-smoke-path",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 779,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L779",
              "doc": {
                "summary": "Stand up a PM4 compute queue end-to-end on the given render node.",
                "description": [
                  "Allocates the ring / wptr / rptr / EOP / CWSR buffer objects with the sizing rules `kfd_queue_acquire_buffers` validates, calls `AMDKFD_IOC_CREATE_QUEUE`, stages a couple of PM4 NOP packets into the ring (no doorbell yet), then destroys the queue and tears everything down. Every BO and ioctl failure is captured in the returned report so the bring-up smoke test can render the exact step that failed."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "DRM render node backing the target GPU."
                  }
                ],
                "returns": "The full smoke report; `.ok()` is true on a clean create/destroy.",
                "notes": [
                  "Off Linux this short-circuits to `unsupported_os` without IO."
                ],
                "raw": "Stand up a PM4 compute queue end-to-end on the given render node. Allocates\nthe ring / wptr / rptr / EOP / CWSR buffer objects with the sizing rules\n`kfd_queue_acquire_buffers` validates, calls `AMDKFD_IOC_CREATE_QUEUE`,\nstages a couple of PM4 NOP packets into the ring (no doorbell yet), then\ndestroys the queue and tears everything down. Every BO and ioctl failure\nis captured in the returned report so the bring-up smoke test can render\nthe exact step that failed."
              },
              "members": []
            },
            {
              "name": "formatGfxTarget",
              "qualified_name": "formatGfxTarget",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn formatGfxTarget(buf: []u8, gfx_target_version: u32) []const u8",
              "anchor": "format-gfx-target",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kfd/#format-gfx-target",
              "source_path": "src/zinc_rt/ring/kfd.zig",
              "source_line": 942,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/kfd.zig#L942",
              "doc": {
                "summary": "Format a `gfx_target_version` integer (e.g.",
                "description": [
                  "120001) as a GFX target string such as `\"gfx1201\"`. The encoding is major×10000 + minor×100 + step, matching the value read from the KFD topology `properties` file. `gfx_target_version` is 0 or the buffer is too small."
                ],
                "params": [
                  {
                    "name": "buf",
                    "description": "Caller-supplied scratch buffer; 16 bytes is sufficient."
                  },
                  {
                    "name": "gfx_target_version",
                    "description": "Encoded GFX IP version, or 0 for an unknown target."
                  }
                ],
                "returns": "A slice into `buf` holding the rendered string, or `\"gfx?\"` when",
                "notes": [],
                "raw": "Format a `gfx_target_version` integer (e.g. 120001) as a GFX target string\nsuch as `\"gfx1201\"`. The encoding is major×10000 + minor×100 + step, matching\nthe value read from the KFD topology `properties` file.\n`gfx_target_version` is 0 or the buffer is too small."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "mod",
          "title": "Mod",
          "section": "Inference Runtime",
          "summary": "Backend-neutral packet batch types for ZINC_RT rings.",
          "overview": [
            "These packet structs are the handoff point between lowered IR and concrete ring implementations such as T-CPU, T2 UMQ, and future direct tiers."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/",
          "source_path": "src/zinc_rt/ring/mod.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/mod.zig#L15",
          "counts": {
            "code_lines": 16,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Packet",
              "qualified_name": "Packet",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const Packet = union(enum)",
              "anchor": "packet",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#packet",
              "source_path": "src/zinc_rt/ring/mod.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/mod.zig#L15",
              "doc": {
                "summary": "Tagged union describing one unit of work submitted to a ZINC_RT ring.",
                "description": [
                  "Each variant carries the CPU ISA parameter struct that fully describes a single decode-step kernel; the `barrier` variant marks an in-stream ordering point with no shader payload."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tagged union describing one unit of work submitted to a ZINC_RT ring.\nEach variant carries the CPU ISA parameter struct that fully describes a\nsingle decode-step kernel; the `barrier` variant marks an in-stream\nordering point with no shader payload."
              },
              "members": []
            },
            {
              "name": "PacketBatch",
              "qualified_name": "PacketBatch",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PacketBatch = struct",
              "anchor": "packet-batch",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/mod/#packet-batch",
              "source_path": "src/zinc_rt/ring/mod.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/mod.zig#L27",
              "doc": {
                "summary": "Borrowed slice of packets that form one submission to a ring.",
                "description": [
                  "Ring implementations consume a batch in order, treating `.barrier` entries as completion fences between adjacent dispatches."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Borrowed slice of packets that form one submission to a ring.\nRing implementations consume a batch in order, treating `.barrier` entries\nas completion fences between adjacent dispatches."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "packet-list",
          "title": "Packet List",
          "section": "Inference Runtime",
          "summary": "Dynamic packet list for building per-token decode sequences.",
          "overview": [
            "T-CPU forward passes use this to accumulate packets before submitting them to the CPU ring for execution."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/",
          "source_path": "src/zinc_rt/ring/packet_list.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L12",
          "counts": {
            "code_lines": 31,
            "exports": 1,
            "methods": 7,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "PacketList",
              "qualified_name": "PacketList",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PacketList = struct",
              "anchor": "packet-list",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list",
              "source_path": "src/zinc_rt/ring/packet_list.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L12",
              "doc": {
                "summary": "Growable buffer used to assemble a `PacketBatch` for one decode step.",
                "description": [
                  "Lowering code pushes packets in execution order, interleaves explicit `barrier` entries between dependent dispatches, and then publishes the resulting slice via `slice()` to whichever ring will run the batch."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Growable buffer used to assemble a `PacketBatch` for one decode step.\nLowering code pushes packets in execution order, interleaves explicit\n`barrier` entries between dependent dispatches, and then publishes the\nresulting slice via `slice()` to whichever ring will run the batch."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "PacketList.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator) PacketList",
                  "anchor": "packet-list-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-init",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 20,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L20",
                  "doc": {
                    "summary": "Create an empty list bound to the given allocator.",
                    "description": [
                      "outlive the list."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Owner of the underlying ArrayList storage; must"
                      }
                    ],
                    "returns": "A `PacketList` with zero packets queued.",
                    "notes": [],
                    "raw": "Create an empty list bound to the given allocator.\noutlive the list."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "PacketList.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *PacketList) void",
                  "anchor": "packet-list-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-deinit",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 29,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L29",
                  "doc": {
                    "summary": "Release the backing storage and poison `self` for use-after-free debug.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "List to tear down; must not be reused afterwards."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the backing storage and poison `self` for use-after-free debug."
                  }
                },
                {
                  "name": "append",
                  "qualified_name": "PacketList.append",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn append(self: *PacketList, packet: ring.Packet) !void",
                  "anchor": "packet-list-append",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-append",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 38,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L38",
                  "doc": {
                    "summary": "Push a payload-bearing packet (embed, rms_norm, lm_head, etc.) onto the end of the list.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "List receiving the packet."
                      },
                      {
                        "name": "packet",
                        "description": "Fully populated packet to enqueue; the value is copied."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Push a payload-bearing packet (embed, rms_norm, lm_head, etc.) onto the\nend of the list."
                  }
                },
                {
                  "name": "appendBarrier",
                  "qualified_name": "PacketList.appendBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn appendBarrier(self: *PacketList) !void",
                  "anchor": "packet-list-append-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-append-barrier",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 47,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L47",
                  "doc": {
                    "summary": "Append a `.barrier` marker that forces the ring to drain prior packets before continuing.",
                    "description": [
                      "buffer (for example, between attention output and the next RMSNorm)."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "List receiving the barrier."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Used between producer/consumer kernels that share a tensor"
                    ],
                    "raw": "Append a `.barrier` marker that forces the ring to drain prior packets\nbefore continuing.\nbuffer (for example, between attention output and the next RMSNorm)."
                  }
                },
                {
                  "name": "slice",
                  "qualified_name": "PacketList.slice",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn slice(self: *const PacketList) []const ring.Packet",
                  "anchor": "packet-list-slice",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-slice",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 54,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L54",
                  "doc": {
                    "summary": "Borrowed view of the current packet sequence.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "List to inspect."
                      }
                    ],
                    "returns": "A slice that stays valid until the next mutation of the list.",
                    "notes": [],
                    "raw": "Borrowed view of the current packet sequence."
                  }
                },
                {
                  "name": "len",
                  "qualified_name": "PacketList.len",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn len(self: *const PacketList) usize",
                  "anchor": "packet-list-len",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-len",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 61,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L61",
                  "doc": {
                    "summary": "Number of packets currently queued, including any barriers.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "List to inspect."
                      }
                    ],
                    "returns": "Packet count.",
                    "notes": [],
                    "raw": "Number of packets currently queued, including any barriers."
                  }
                },
                {
                  "name": "clear",
                  "qualified_name": "PacketList.clear",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn clear(self: *PacketList) void",
                  "anchor": "packet-list-clear",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet-list/#packet-list-clear",
                  "source_path": "src/zinc_rt/ring/packet_list.zig",
                  "source_line": 68,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet_list.zig#L68",
                  "doc": {
                    "summary": "Drop all queued packets while keeping the allocated capacity, so the list can be reused for the next decode step without re-allocating.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "List to reset."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Drop all queued packets while keeping the allocated capacity, so the\nlist can be reused for the next decode step without re-allocating."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "packet",
          "title": "Packet",
          "section": "Inference Runtime",
          "summary": "PM4 packet builder shared by direct AMD ZINC_RT tiers.",
          "overview": [
            "This is intentionally syntax-only: it does not know about model shapes or IR op semantics. M1 lowering hands already-decided register writes and dispatch dimensions to this builder, then T2/T1 copy the resulting dwords into their user queue rings."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/",
          "source_path": "src/zinc_rt/ring/packet.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L13",
          "counts": {
            "code_lines": 237,
            "exports": 11,
            "methods": 13,
            "symbols": 24
          },
          "symbols": [
            {
              "name": "Error",
              "qualified_name": "Error",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Error = error{OutOfSpace}",
              "anchor": "error",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#error",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L13",
              "doc": {
                "summary": "Failure modes returned by `PacketBuilder` operations.",
                "description": [
                  "`OutOfSpace` means the caller-provided dword buffer cannot fit another PM4 packet without overrunning its bounds."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Failure modes returned by `PacketBuilder` operations.\n`OutOfSpace` means the caller-provided dword buffer cannot fit another\nPM4 packet without overrunning its bounds."
              },
              "members": []
            },
            {
              "name": "sh_reg_num_thread_x",
              "qualified_name": "sh_reg_num_thread_x",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const sh_reg_num_thread_x: u32 = 0x207",
              "anchor": "sh-reg-num-thread-x",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#sh-reg-num-thread-x",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L34",
              "doc": {
                "summary": "SH register offset for `COMPUTE_NUM_THREAD_X` (workgroup X dimension).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_NUM_THREAD_X` (workgroup X dimension)."
              },
              "members": []
            },
            {
              "name": "sh_reg_pgm_lo",
              "qualified_name": "sh_reg_pgm_lo",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const sh_reg_pgm_lo: u32 = 0x20c",
              "anchor": "sh-reg-pgm-lo",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#sh-reg-pgm-lo",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L36",
              "doc": {
                "summary": "SH register offset for `COMPUTE_PGM_LO` (low 32 bits of the shader address).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_PGM_LO` (low 32 bits of the shader address)."
              },
              "members": []
            },
            {
              "name": "sh_reg_pgm_rsrc1",
              "qualified_name": "sh_reg_pgm_rsrc1",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const sh_reg_pgm_rsrc1: u32 = 0x212",
              "anchor": "sh-reg-pgm-rsrc1",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#sh-reg-pgm-rsrc1",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L38",
              "doc": {
                "summary": "SH register offset for `COMPUTE_PGM_RSRC1` (VGPR/SGPR counts and float mode).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_PGM_RSRC1` (VGPR/SGPR counts and float mode)."
              },
              "members": []
            },
            {
              "name": "sh_reg_resource_limits",
              "qualified_name": "sh_reg_resource_limits",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const sh_reg_resource_limits: u32 = 0x215",
              "anchor": "sh-reg-resource-limits",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#sh-reg-resource-limits",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 40,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L40",
              "doc": {
                "summary": "SH register offset for `COMPUTE_RESOURCE_LIMITS` (waves-per-CU and locking).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_RESOURCE_LIMITS` (waves-per-CU and locking)."
              },
              "members": []
            },
            {
              "name": "sh_reg_pgm_rsrc3",
              "qualified_name": "sh_reg_pgm_rsrc3",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const sh_reg_pgm_rsrc3: u32 = 0x228",
              "anchor": "sh-reg-pgm-rsrc3",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#sh-reg-pgm-rsrc3",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 42,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L42",
              "doc": {
                "summary": "SH register offset for `COMPUTE_PGM_RSRC3` (extra GFX11+ shader resource bits).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_PGM_RSRC3` (extra GFX11+ shader resource bits)."
              },
              "members": []
            },
            {
              "name": "compute_user_data_0",
              "qualified_name": "compute_user_data_0",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const compute_user_data_0: u32 = 0x240",
              "anchor": "compute-user-data-0",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#compute-user-data-0",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 45,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L45",
              "doc": {
                "summary": "SH register offset for `COMPUTE_USER_DATA_0`; subsequent slots are contiguous and used to pass kernel argument pointers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "SH register offset for `COMPUTE_USER_DATA_0`; subsequent slots are\ncontiguous and used to pass kernel argument pointers."
              },
              "members": []
            },
            {
              "name": "dispatch_initiator_compute",
              "qualified_name": "dispatch_initiator_compute",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const dispatch_initiator_compute: u32 = 5",
              "anchor": "dispatch-initiator-compute",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#dispatch-initiator-compute",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 47,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L47",
              "doc": {
                "summary": "Default `DISPATCH_INITIATOR` value enabling the compute pipeline.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Default `DISPATCH_INITIATOR` value enabling the compute pipeline."
              },
              "members": []
            },
            {
              "name": "PacketBuilder",
              "qualified_name": "PacketBuilder",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PacketBuilder = struct",
              "anchor": "packet-builder",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 54,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L54",
              "doc": {
                "summary": "Cursor-style writer that emits PM4 type-3 packets into a caller-owned dword buffer.",
                "description": [
                  "The builder is allocation-free and stateless beyond a write cursor, so callers can reuse the same backing buffer across submissions by calling `reset`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Cursor-style writer that emits PM4 type-3 packets into a caller-owned\ndword buffer.\nThe builder is allocation-free and stateless beyond a write cursor, so\ncallers can reuse the same backing buffer across submissions by calling\n`reset`."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "PacketBuilder.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(words: []u32) PacketBuilder",
                  "anchor": "packet-builder-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-init",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 62,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L62",
                  "doc": {
                    "summary": "Wrap a pre-allocated dword buffer.",
                    "description": [
                      "index 0 and never grows the slice."
                    ],
                    "params": [
                      {
                        "name": "words",
                        "description": "Backing storage; the builder writes packets starting at"
                      }
                    ],
                    "returns": "A builder pointing at `words` with an empty write cursor.",
                    "notes": [],
                    "raw": "Wrap a pre-allocated dword buffer.\nindex 0 and never grows the slice."
                  }
                },
                {
                  "name": "reset",
                  "qualified_name": "PacketBuilder.reset",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn reset(self: *PacketBuilder) void",
                  "anchor": "packet-builder-reset",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-reset",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 68,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L68",
                  "doc": {
                    "summary": "Rewind the write cursor without touching the backing buffer.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to reset; subsequent writes overwrite previous dwords."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Rewind the write cursor without touching the backing buffer."
                  }
                },
                {
                  "name": "written",
                  "qualified_name": "PacketBuilder.written",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn written(self: *const PacketBuilder) []const u32",
                  "anchor": "packet-builder-written",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-written",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 75,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L75",
                  "doc": {
                    "summary": "Borrowed view of the dwords emitted so far.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to inspect."
                      }
                    ],
                    "returns": "Slice of finalized packet words, ready to copy into a ring.",
                    "notes": [],
                    "raw": "Borrowed view of the dwords emitted so far."
                  }
                },
                {
                  "name": "writeNop",
                  "qualified_name": "PacketBuilder.writeNop",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeNop(self: *PacketBuilder, payload_dwords: u32) Error!void",
                  "anchor": "packet-builder-write-nop",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-write-nop",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 83,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L83",
                  "doc": {
                    "summary": "Emit a PM4 `NOP` packet that consumes `payload_dwords` body dwords.",
                    "description": [
                      "minimum of 1 to satisfy the PKT3 body-size encoding."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "payload_dwords",
                        "description": "Number of zero payload dwords; clamped to a"
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Emit a PM4 `NOP` packet that consumes `payload_dwords` body dwords.\nminimum of 1 to satisfy the PKT3 body-size encoding."
                  }
                },
                {
                  "name": "setShReg",
                  "qualified_name": "PacketBuilder.setShReg",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setShReg(self: *PacketBuilder, reg_offset: u32, values: []const u32) Error!void",
                  "anchor": "packet-builder-set-sh-reg",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-set-sh-reg",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 94,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L94",
                  "doc": {
                    "summary": "Emit `SET_SH_REG` writing `values` into consecutive SH register slots.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "reg_offset",
                        "description": "Starting SH register offset (dword units from 0xB000)."
                      },
                      {
                        "name": "values",
                        "description": "Register values written in order; an empty slice is a no-op."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Emit `SET_SH_REG` writing `values` into consecutive SH register slots."
                  }
                },
                {
                  "name": "setShRegOne",
                  "qualified_name": "PacketBuilder.setShRegOne",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setShRegOne(self: *PacketBuilder, reg_offset: u32, value: u32) Error!void",
                  "anchor": "packet-builder-set-sh-reg-one",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-set-sh-reg-one",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 107,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L107",
                  "doc": {
                    "summary": "Convenience helper that writes a single SH register.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "reg_offset",
                        "description": "SH register offset."
                      },
                      {
                        "name": "value",
                        "description": "Value to write into that register."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Convenience helper that writes a single SH register."
                  }
                },
                {
                  "name": "setUserData64",
                  "qualified_name": "PacketBuilder.setUserData64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setUserData64(self: *PacketBuilder, slot: u32, value: u64) Error!void",
                  "anchor": "packet-builder-set-user-data64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-set-user-data64",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 117,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L117",
                  "doc": {
                    "summary": "Write a 64-bit value into a pair of contiguous `COMPUTE_USER_DATA_*` slots, little-endian (low dword first).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "slot",
                        "description": "Zero-based index added to `compute_user_data_0`."
                      },
                      {
                        "name": "value",
                        "description": "64-bit kernel argument (typically a GPU virtual address)."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Write a 64-bit value into a pair of contiguous `COMPUTE_USER_DATA_*`\nslots, little-endian (low dword first)."
                  }
                },
                {
                  "name": "dispatchDirect",
                  "qualified_name": "PacketBuilder.dispatchDirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchDirect(self: *PacketBuilder, dim_x: u32, dim_y: u32, dim_z: u32) Error!void",
                  "anchor": "packet-builder-dispatch-direct",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-dispatch-direct",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 129,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L129",
                  "doc": {
                    "summary": "Emit `DISPATCH_DIRECT` with a zero dispatch-initiator field.",
                    "description": [
                      "Prefer `dispatchDirectInitiator` when `COMPUTE_DISPATCH_INITIATOR` bits must be set explicitly (e.g. `dispatch_initiator_compute`)."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "dim_x",
                        "description": "Workgroup count on X."
                      },
                      {
                        "name": "dim_y",
                        "description": "Workgroup count on Y."
                      },
                      {
                        "name": "dim_z",
                        "description": "Workgroup count on Z."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Emit `DISPATCH_DIRECT` with a zero dispatch-initiator field.\nPrefer `dispatchDirectInitiator` when `COMPUTE_DISPATCH_INITIATOR` bits\nmust be set explicitly (e.g. `dispatch_initiator_compute`)."
                  }
                },
                {
                  "name": "dispatchDirectInitiator",
                  "qualified_name": "PacketBuilder.dispatchDirectInitiator",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchDirectInitiator( self: *PacketBuilder, dim_x: u32, dim_y: u32, dim_z: u32, dispatch_initiator: u32, ) Error!void",
                  "anchor": "packet-builder-dispatch-direct-initiator",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-dispatch-direct-initiator",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 141,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L141",
                  "doc": {
                    "summary": "Emit `DISPATCH_DIRECT` with a caller-supplied dispatch initiator value.",
                    "description": [
                      "to take the firmware default or use `dispatch_initiator_compute` to force-enable the compute pipeline."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "dim_x",
                        "description": "Workgroup count on X."
                      },
                      {
                        "name": "dim_y",
                        "description": "Workgroup count on Y."
                      },
                      {
                        "name": "dim_z",
                        "description": "Workgroup count on Z."
                      },
                      {
                        "name": "dispatch_initiator",
                        "description": "Raw `COMPUTE_DISPATCH_INITIATOR` bits; pass 0"
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Emit `DISPATCH_DIRECT` with a caller-supplied dispatch initiator value.\nto take the firmware default or use `dispatch_initiator_compute`\nto force-enable the compute pipeline."
                  }
                },
                {
                  "name": "releaseMemSignal",
                  "qualified_name": "PacketBuilder.releaseMemSignal",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn releaseMemSignal(self: *PacketBuilder, gpu_addr: u64, value: u64) Error!void",
                  "anchor": "packet-builder-release-mem-signal",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-release-mem-signal",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 163,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L163",
                  "doc": {
                    "summary": "Emit a GFX10+ `RELEASE_MEM` end-of-pipe fence that writes `value` to `gpu_addr` after prior shader work and global-memory writes complete.",
                    "description": [
                      "compute-ring fences; older ASICs are not a ZINC_RT direct target."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "gpu_addr",
                        "description": "64-bit GPU virtual address to receive the fence value."
                      },
                      {
                        "name": "value",
                        "description": "Fence payload (typically a monotonically increasing seqno)."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "This uses the GFX10+ release-mem packet layout used by amdgpu for"
                    ],
                    "raw": "Emit a GFX10+ `RELEASE_MEM` end-of-pipe fence that writes `value` to\n`gpu_addr` after prior shader work and global-memory writes complete.\ncompute-ring fences; older ASICs are not a ZINC_RT direct target."
                  }
                },
                {
                  "name": "writeData64",
                  "qualified_name": "PacketBuilder.writeData64",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeData64(self: *PacketBuilder, gpu_addr: u64, value: u64) Error!void",
                  "anchor": "packet-builder-write-data64",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-write-data64",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 206,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L206",
                  "doc": {
                    "summary": "Emit `WRITE_DATA` that stores `value` (64 bits) at `gpu_addr` via the ME (micro-engine) with WR_CONFIRM set.",
                    "description": [
                      "The ME stalls until the write lands in memory (WR_CONFIRM=1), so callers observe the value as soon as the packet retires."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "gpu_addr",
                        "description": "Destination GPU virtual address."
                      },
                      {
                        "name": "value",
                        "description": "64-bit payload written little-endian."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Uses `dst_sel=5` (memory async/direct) and `engine_sel=0` (ME)."
                    ],
                    "raw": "Emit `WRITE_DATA` that stores `value` (64 bits) at `gpu_addr` via the\nME (micro-engine) with WR_CONFIRM set.\nThe ME stalls until the write lands in memory (WR_CONFIRM=1), so\ncallers observe the value as soon as the packet retires."
                  }
                },
                {
                  "name": "copyData32",
                  "qualified_name": "PacketBuilder.copyData32",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn copyData32(self: *PacketBuilder, src_gpu_addr: u64, dst_gpu_addr: u64) Error!void",
                  "anchor": "packet-builder-copy-data32",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-copy-data32",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 229,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L229",
                  "doc": {
                    "summary": "Emit `COPY_DATA` that copies a single 32-bit dword from one GPU memory address to another with WR_CONFIRM set.",
                    "description": [
                      "command processor stalls until the destination write completes."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to append to."
                      },
                      {
                        "name": "src_gpu_addr",
                        "description": "Source GPU virtual address (memory, src_sel=1)."
                      },
                      {
                        "name": "dst_gpu_addr",
                        "description": "Destination GPU virtual address (memory, dst_sel=5)."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Copies exactly 32 bits (count_sel=0). WR_CONFIRM=1 means the"
                    ],
                    "raw": "Emit `COPY_DATA` that copies a single 32-bit dword from one GPU memory\naddress to another with WR_CONFIRM set.\ncommand processor stalls until the destination write completes."
                  }
                },
                {
                  "name": "padToAlignment",
                  "qualified_name": "PacketBuilder.padToAlignment",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn padToAlignment(self: *PacketBuilder, dword_alignment: usize) Error!void",
                  "anchor": "packet-builder-pad-to-alignment",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#packet-builder-pad-to-alignment",
                  "source_path": "src/zinc_rt/ring/packet.zig",
                  "source_line": 253,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L253",
                  "doc": {
                    "summary": "Pad the buffer with `NOP` packets until the current write cursor is a multiple of `dword_alignment` dwords.",
                    "description": [
                      "in a single packet rather than spinning out many minimum-size NOPs."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Builder to pad."
                      },
                      {
                        "name": "dword_alignment",
                        "description": "Required alignment in dwords (0 is a no-op)."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Each emitted NOP carries enough payload to land on the alignment"
                    ],
                    "raw": "Pad the buffer with `NOP` packets until the current write cursor is a\nmultiple of `dword_alignment` dwords.\nin a single packet rather than spinning out many minimum-size NOPs."
                  }
                }
              ]
            },
            {
              "name": "lo32",
              "qualified_name": "lo32",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn lo32(value: u64) u32",
              "anchor": "lo32",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#lo32",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 283,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L283",
              "doc": {
                "summary": "Extract the low 32 bits of a 64-bit value for little-endian dword writes.",
                "description": [],
                "params": [
                  {
                    "name": "value",
                    "description": "64-bit input."
                  }
                ],
                "returns": "Bits [31:0] of `value`.",
                "notes": [],
                "raw": "Extract the low 32 bits of a 64-bit value for little-endian dword writes."
              },
              "members": []
            },
            {
              "name": "hi32",
              "qualified_name": "hi32",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn hi32(value: u64) u32",
              "anchor": "hi32",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/packet/#hi32",
              "source_path": "src/zinc_rt/ring/packet.zig",
              "source_line": 290,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/packet.zig#L290",
              "doc": {
                "summary": "Extract the high 32 bits of a 64-bit value for little-endian dword writes.",
                "description": [],
                "params": [
                  {
                    "name": "value",
                    "description": "64-bit input."
                  }
                ],
                "returns": "Bits [63:32] of `value`.",
                "notes": [],
                "raw": "Extract the high 32 bits of a 64-bit value for little-endian dword writes."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "umq",
          "title": "Umq",
          "section": "Inference Runtime",
          "summary": "AMDGPU user-mode queue (T2) availability and create/free smoke gate.",
          "overview": [
            "AMDGPU uses UMQ for direct submission on Linux kernels that expose the AMDGPU user queue ABI. The preflight is intentionally cheap, while the smoke gate exercises the actual GEM/VA/USERQ_CREATE/USERQ_FREE path required before lowering decode packets onto T2."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/",
          "source_path": "src/zinc_rt/ring/umq.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L15",
          "counts": {
            "code_lines": 306,
            "exports": 17,
            "methods": 2,
            "symbols": 19
          },
          "symbols": [
            {
              "name": "min_linux_major",
              "qualified_name": "min_linux_major",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const min_linux_major: u32 = 6",
              "anchor": "min-linux-major",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#min-linux-major",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L15",
              "doc": {
                "summary": "Lowest Linux major version that exposes the AMDGPU user-queue ABI used by T2.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Lowest Linux major version that exposes the AMDGPU user-queue ABI used by T2."
              },
              "members": []
            },
            {
              "name": "min_linux_minor",
              "qualified_name": "min_linux_minor",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const min_linux_minor: u32 = 16",
              "anchor": "min-linux-minor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#min-linux-minor",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 17,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L17",
              "doc": {
                "summary": "Lowest Linux minor version paired with `min_linux_major` for UMQ admission.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Lowest Linux minor version paired with `min_linux_major` for UMQ admission."
              },
              "members": []
            },
            {
              "name": "default_render_node",
              "qualified_name": "default_render_node",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const default_render_node = \"/dev/dri/renderD128\"",
              "anchor": "default-render-node",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#default-render-node",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L19",
              "doc": {
                "summary": "Default render node opened when no caller-supplied path is provided.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Default render node opened when no caller-supplied path is provided."
              },
              "members": []
            },
            {
              "name": "user_queue_param_path",
              "qualified_name": "user_queue_param_path",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const user_queue_param_path = \"/sys/module/amdgpu/parameters/user_queue\"",
              "anchor": "user-queue-param-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#user-queue-param-path",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L21",
              "doc": {
                "summary": "Sysfs path exposing the `amdgpu.user_queue` module parameter that gates UMQ.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Sysfs path exposing the `amdgpu.user_queue` module parameter that gates UMQ."
              },
              "members": []
            },
            {
              "name": "ProbeStatus",
              "qualified_name": "ProbeStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const ProbeStatus = enum",
              "anchor": "probe-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#probe-status",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 25,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L25",
              "doc": {
                "summary": "Outcome of the cheap UMQ preflight check; ordered from success to specific failure modes so callers can report actionable diagnostics.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome of the cheap UMQ preflight check; ordered from success to specific\nfailure modes so callers can report actionable diagnostics."
              },
              "members": []
            },
            {
              "name": "KernelVersion",
              "qualified_name": "KernelVersion",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KernelVersion = struct",
              "anchor": "kernel-version",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#kernel-version",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 35,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L35",
              "doc": {
                "summary": "Parsed Linux kernel release triple used to compare against `min_linux_*`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Parsed Linux kernel release triple used to compare against `min_linux_*`."
              },
              "members": []
            },
            {
              "name": "ProbeResult",
              "qualified_name": "ProbeResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ProbeResult = struct",
              "anchor": "probe-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#probe-result",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 43,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L43",
              "doc": {
                "summary": "Aggregate output of `probePath` carrying both the verdict and the evidence (kernel version, render node tried, user-queue mode value) used to reach it.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Aggregate output of `probePath` carrying both the verdict and the evidence\n(kernel version, render node tried, user-queue mode value) used to reach it."
              },
              "members": [
                {
                  "name": "preflightOk",
                  "qualified_name": "ProbeResult.preflightOk",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn preflightOk(self: ProbeResult) bool",
                  "anchor": "probe-result-preflight-ok",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#probe-result-preflight-ok",
                  "source_path": "src/zinc_rt/ring/umq.zig",
                  "source_line": 52,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L52",
                  "doc": {
                    "summary": "Whether the preflight succeeded and the host is eligible for T2 UMQ.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Result to inspect."
                      }
                    ],
                    "returns": "True only when `status == .preflight_ok`.",
                    "notes": [],
                    "raw": "Whether the preflight succeeded and the host is eligible for T2 UMQ."
                  }
                }
              ]
            },
            {
              "name": "SmokeStatus",
              "qualified_name": "SmokeStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const SmokeStatus = enum",
              "anchor": "smoke-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#smoke-status",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 59,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L59",
              "doc": {
                "summary": "Outcome of the full create/free smoke gate that exercises the real GEM/VA/USERQ ioctl path required before T2 lowering can run.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome of the full create/free smoke gate that exercises the real\nGEM/VA/USERQ ioctl path required before T2 lowering can run."
              },
              "members": []
            },
            {
              "name": "SmokeResult",
              "qualified_name": "SmokeResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SmokeResult = struct",
              "anchor": "smoke-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#smoke-result",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 77,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L77",
              "doc": {
                "summary": "Aggregate output of the UMQ create/free smoke test.",
                "description": [
                  "Carries the verdict, the queue id returned by `USERQ_CREATE` when one was obtained, the upstream errno on ioctl failures, and the firmware-reported metadata (queue slots and EOP buffer requirements) needed to size resources on subsequent runs."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Aggregate output of the UMQ create/free smoke test.\nCarries the verdict, the queue id returned by `USERQ_CREATE` when one was\nobtained, the upstream errno on ioctl failures, and the firmware-reported\nmetadata (queue slots and EOP buffer requirements) needed to size resources\non subsequent runs."
              },
              "members": [
                {
                  "name": "ok",
                  "qualified_name": "SmokeResult.ok",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn ok(self: SmokeResult) bool",
                  "anchor": "smoke-result-ok",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#smoke-result-ok",
                  "source_path": "src/zinc_rt/ring/umq.zig",
                  "source_line": 90,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L90",
                  "doc": {
                    "summary": "True when the smoke gate reached `USERQ_FREE` cleanly.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Smoke result to inspect."
                      }
                    ],
                    "returns": "True only when `status == .passed`.",
                    "notes": [],
                    "raw": "True when the smoke gate reached `USERQ_FREE` cleanly."
                  }
                }
              ]
            },
            {
              "name": "probeDefault",
              "qualified_name": "probeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn probeDefault() ProbeResult",
              "anchor": "probe-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#probe-default",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 97,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L97",
              "doc": {
                "summary": "Run the cheap UMQ preflight against the default render node.",
                "description": [],
                "params": [],
                "returns": "A `ProbeResult` describing whether T2 admission is plausible.",
                "notes": [],
                "raw": "Run the cheap UMQ preflight against the default render node."
              },
              "members": []
            },
            {
              "name": "admissionProbeDefault",
              "qualified_name": "admissionProbeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn admissionProbeDefault() bool",
              "anchor": "admission-probe-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#admission-probe-default",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 105,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L105",
              "doc": {
                "summary": "One-shot admission helper combining the preflight and the `kmd.queryComputeUserq` capability query.",
                "description": [
                  "`available` compute user-queue capability."
                ],
                "params": [],
                "returns": "True only when the host both passes preflight and reports an",
                "notes": [],
                "raw": "One-shot admission helper combining the preflight and the\n`kmd.queryComputeUserq` capability query.\n`available` compute user-queue capability."
              },
              "members": []
            },
            {
              "name": "createFreeSmokeDefault",
              "qualified_name": "createFreeSmokeDefault",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createFreeSmokeDefault() SmokeResult",
              "anchor": "create-free-smoke-default",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#create-free-smoke-default",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 115,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L115",
              "doc": {
                "summary": "Run the full create/free smoke gate against the default render node.",
                "description": [],
                "params": [],
                "returns": "A `SmokeResult` recording every step that succeeded or failed.",
                "notes": [],
                "raw": "Run the full create/free smoke gate against the default render node."
              },
              "members": []
            },
            {
              "name": "createFreeSmokePath",
              "qualified_name": "createFreeSmokePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createFreeSmokePath(render_node: []const u8) SmokeResult",
              "anchor": "create-free-smoke-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#create-free-smoke-path",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 125,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L125",
              "doc": {
                "summary": "Run the full create/free smoke gate against an explicit render node path.",
                "description": [
                  "Performs preflight, queries the compute user-queue capability, allocates the GEM buffers required by `USERQ_CREATE`, maps their VAs, creates a compute queue, and finally frees it."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Absolute path to a DRM render node (e.g. `/dev/dri/renderD128`)."
                  }
                ],
                "returns": "A `SmokeResult`; inspect `status` and `errno` to localize failures.",
                "notes": [],
                "raw": "Run the full create/free smoke gate against an explicit render node path.\nPerforms preflight, queries the compute user-queue capability, allocates\nthe GEM buffers required by `USERQ_CREATE`, maps their VAs, creates a\ncompute queue, and finally frees it."
              },
              "members": []
            },
            {
              "name": "probePath",
              "qualified_name": "probePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn probePath(render_node: []const u8) ProbeResult",
              "anchor": "probe-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#probe-path",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 155,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L155",
              "doc": {
                "summary": "Cheap preflight that walks the OS, kernel-version, render-node, and `user_queue` module-parameter checks without issuing any ioctls.",
                "description": [
                  "check, or `preflight_ok` when every check passed."
                ],
                "params": [
                  {
                    "name": "render_node",
                    "description": "Path to the DRM render node that would be opened later."
                  }
                ],
                "returns": "A `ProbeResult` whose `status` pinpoints the earliest failing",
                "notes": [],
                "raw": "Cheap preflight that walks the OS, kernel-version, render-node, and\n`user_queue` module-parameter checks without issuing any ioctls.\ncheck, or `preflight_ok` when every check passed."
              },
              "members": []
            },
            {
              "name": "kernelSupportsUmq",
              "qualified_name": "kernelSupportsUmq",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn kernelSupportsUmq(version: KernelVersion) bool",
              "anchor": "kernel-supports-umq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#kernel-supports-umq",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 315,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L315",
              "doc": {
                "summary": "Whether the parsed kernel version meets the minimum required for UMQ.",
                "description": [],
                "params": [
                  {
                    "name": "version",
                    "description": "Kernel version produced by `parseKernelRelease`."
                  }
                ],
                "returns": "True when `version >= 6.16`.",
                "notes": [],
                "raw": "Whether the parsed kernel version meets the minimum required for UMQ."
              },
              "members": []
            },
            {
              "name": "parseKernelRelease",
              "qualified_name": "parseKernelRelease",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseKernelRelease(release: []const u8) ?KernelVersion",
              "anchor": "parse-kernel-release",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#parse-kernel-release",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 325,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L325",
              "doc": {
                "summary": "Parse a `uname -r` style release string into a `KernelVersion`.",
                "description": [
                  "Distro suffixes and `-rc` tags after the numeric components are tolerated; the patch component defaults to 0 when absent."
                ],
                "params": [
                  {
                    "name": "release",
                    "description": "Release string such as `6.16.0-24-generic` or `6.16-rc4`."
                  }
                ],
                "returns": "The parsed triple, or null when the leading components are not numeric.",
                "notes": [],
                "raw": "Parse a `uname -r` style release string into a `KernelVersion`.\nDistro suffixes and `-rc` tags after the numeric components are tolerated;\nthe patch component defaults to 0 when absent."
              },
              "members": []
            },
            {
              "name": "userQueueModeEnablesUmq",
              "qualified_name": "userQueueModeEnablesUmq",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn userQueueModeEnablesUmq(mode: i32) bool",
              "anchor": "user-queue-mode-enables-umq",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/umq/#user-queue-mode-enables-umq",
              "source_path": "src/zinc_rt/ring/umq.zig",
              "source_line": 358,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/ring/umq.zig#L358",
              "doc": {
                "summary": "Whether the `amdgpu.user_queue` module-parameter value enables UMQ admission.",
                "description": [],
                "params": [
                  {
                    "name": "mode",
                    "description": "Integer read from `/sys/module/amdgpu/parameters/user_queue`."
                  }
                ],
                "returns": "True for `-1` (auto), `1` (enabled), or `2` (forced); false otherwise.",
                "notes": [],
                "raw": "Whether the `amdgpu.user_queue` module-parameter value enables UMQ\nadmission."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "sampling",
      "title": "Sampling",
      "description": "Logit post-processing, argmax helpers, and token-selection controls layered on top of the decode runtime.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#sampling",
      "module_count": 2,
      "symbol_count": 8,
      "modules": [
        {
          "slug": "argmax",
          "title": "Argmax",
          "section": "Sampling",
          "summary": "Wrap the GPU argmax reduction used for greedy token sampling.",
          "overview": [
            "This helper owns the compute pipeline for the two-phase argmax shader and records the reduction dispatches that pick the next token entirely on GPU."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/",
          "source_path": "src/compute/argmax.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L20",
          "counts": {
            "code_lines": 123,
            "exports": 1,
            "methods": 5,
            "symbols": 6
          },
          "symbols": [
            {
              "name": "ArgmaxDispatch",
              "qualified_name": "ArgmaxDispatch",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ArgmaxDispatch = struct",
              "anchor": "argmax-dispatch",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch",
              "source_path": "src/compute/argmax.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L20",
              "doc": {
                "summary": "GPU-accelerated two-phase argmax reduction for greedy token sampling.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GPU-accelerated two-phase argmax reduction for greedy token sampling."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ArgmaxDispatch.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( instance: *const Instance, shader_dir: []const u8, allocator: std.mem.Allocator, ) !ArgmaxDispatch",
                  "anchor": "argmax-dispatch-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch-init",
                  "source_path": "src/compute/argmax.zig",
                  "source_line": 30,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L30",
                  "doc": {
                    "summary": "Create the argmax compute pipeline and descriptor pool on the given Vulkan instance.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Vulkan instance that owns the device used for all Vulkan calls."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Directory path searched for `argmax.spv`; if the shader is missing the pipeline is set to null and a warning is logged."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used internally by the pipeline creation helper."
                      }
                    ],
                    "returns": "An initialised `ArgmaxDispatch`; the caller must call `deinit` to release GPU resources.",
                    "notes": [],
                    "raw": "Create the argmax compute pipeline and descriptor pool on the given Vulkan instance."
                  }
                },
                {
                  "name": "record",
                  "qualified_name": "ArgmaxDispatch.record",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn record( self: *const ArgmaxDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_logits: u32, phase0_workgroups: u32, ) !void",
                  "anchor": "argmax-dispatch-record",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch-record",
                  "source_path": "src/compute/argmax.zig",
                  "source_line": 78,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L78",
                  "doc": {
                    "summary": "Record the two-phase argmax reduction into a command buffer.",
                    "description": [
                      "Phase 0 dispatches `phase0_workgroups` workgroups that each reduce a slice of the logit vector and write partial (value, index) results; phase 1 dispatches a single workgroup that reduces those partials to the final winner. A compute barrier is inserted between the two phases."
                    ],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record dispatches into."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with logits, partials, and result buffers already bound."
                      },
                      {
                        "name": "n_logits",
                        "description": "Total number of logits in the input buffer (vocabulary size)."
                      },
                      {
                        "name": "phase0_workgroups",
                        "description": "Number of workgroups launched in phase 0; also the number of partial results consumed by phase 1."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Record the two-phase argmax reduction into a command buffer.\nPhase 0 dispatches `phase0_workgroups` workgroups that each reduce a slice of the logit\nvector and write partial (value, index) results; phase 1 dispatches a single workgroup\nthat reduces those partials to the final winner.  A compute barrier is inserted between\nthe two phases."
                  }
                },
                {
                  "name": "allocDescriptorSet",
                  "qualified_name": "ArgmaxDispatch.allocDescriptorSet",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn allocDescriptorSet(self: *const ArgmaxDispatch) !vk.c.VkDescriptorSet",
                  "anchor": "argmax-dispatch-alloc-descriptor-set",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch-alloc-descriptor-set",
                  "source_path": "src/compute/argmax.zig",
                  "source_line": 104,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L104",
                  "doc": {
                    "summary": "Allocate a descriptor set from the argmax descriptor pool.",
                    "description": [],
                    "params": [],
                    "returns": "A freshly allocated `VkDescriptorSet` using the pipeline's layout, or an error if allocation fails or the shader was not loaded.",
                    "notes": [
                      "The set must be freed back to the pool before calling `deinit`."
                    ],
                    "raw": "Allocate a descriptor set from the argmax descriptor pool."
                  }
                },
                {
                  "name": "writeDescriptorSet",
                  "qualified_name": "ArgmaxDispatch.writeDescriptorSet",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeDescriptorSet( self: *const ArgmaxDispatch, descriptor_set: vk.c.VkDescriptorSet, logits_buf: vk.c.VkBuffer, logits_size: vk.c.VkDeviceSize, partials_buf: vk.c.VkBuffer, partials_size: vk.c.VkDeviceSize, result_buf: vk.c.VkBuffer, result_size: vk.c.VkDeviceSize, ) void",
                  "anchor": "argmax-dispatch-write-descriptor-set",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch-write-descriptor-set",
                  "source_path": "src/compute/argmax.zig",
                  "source_line": 128,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L128",
                  "doc": {
                    "summary": "Bind the logits, partials, and result buffers to a descriptor set via `vkUpdateDescriptorSets`.",
                    "description": [
                      "The three buffers map to shader bindings 0, 1, and 2 respectively."
                    ],
                    "params": [
                      {
                        "name": "descriptor_set",
                        "description": "Target descriptor set to update (must have been allocated via `allocDescriptorSet`)."
                      },
                      {
                        "name": "logits_buf",
                        "description": "Storage buffer containing the raw logit values (shader binding 0)."
                      },
                      {
                        "name": "logits_size",
                        "description": "Byte range of `logits_buf` to expose to the shader."
                      },
                      {
                        "name": "partials_buf",
                        "description": "Intermediate storage buffer for phase-0 partial results (shader binding 1)."
                      },
                      {
                        "name": "partials_size",
                        "description": "Byte range of `partials_buf` to expose to the shader."
                      },
                      {
                        "name": "result_buf",
                        "description": "Output storage buffer that receives the winning token index after phase 1 (shader binding 2)."
                      },
                      {
                        "name": "result_size",
                        "description": "Byte range of `result_buf` to expose to the shader."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Bind the logits, partials, and result buffers to a descriptor set via `vkUpdateDescriptorSets`.\nThe three buffers map to shader bindings 0, 1, and 2 respectively."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ArgmaxDispatch.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ArgmaxDispatch) void",
                  "anchor": "argmax-dispatch-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#argmax-dispatch-deinit",
                  "source_path": "src/compute/argmax.zig",
                  "source_line": 162,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/argmax.zig#L162",
                  "doc": {
                    "summary": "Destroy the pipeline and descriptor pool.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the pipeline and descriptor pool."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "argmax",
          "title": "Argmax",
          "section": "Sampling",
          "summary": "T-CPU ARGMAX implementation.",
          "overview": [
            "The CPU oracle selects token IDs from logits with deterministic tie behavior that GPU tiers can match during validation."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/",
          "source_path": "src/zinc_rt/isa/cpu_zig/argmax.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/argmax.zig#L10",
          "counts": {
            "code_lines": 23,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "Params",
              "qualified_name": "Params",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Params = struct",
              "anchor": "params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#params",
              "source_path": "src/zinc_rt/isa/cpu_zig/argmax.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/argmax.zig#L10",
              "doc": {
                "summary": "Inputs and outputs for one ARGMAX call.",
                "description": [],
                "params": [
                  {
                    "name": "logits",
                    "description": "Flat vector of vocabulary scores; must be non-empty."
                  },
                  {
                    "name": "output",
                    "description": "Destination for the chosen token index (overwritten on success)."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Inputs and outputs for one ARGMAX call."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(params: Params) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/argmax/#run",
              "source_path": "src/zinc_rt/isa/cpu_zig/argmax.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/zinc_rt/isa/cpu_zig/argmax.zig#L19",
              "doc": {
                "summary": "Scan the logits vector and write the index of the largest element to `params.output`.",
                "description": [
                  "Ties resolve to the earlier index, matching the GPU oracle."
                ],
                "params": [
                  {
                    "name": "params",
                    "description": "Logits vector and output index slot; the vector must contain at least one value."
                  }
                ],
                "returns": "`error.EmptyInput` when `params.logits.len == 0`, otherwise void.",
                "notes": [],
                "raw": "Scan the logits vector and write the index of the largest element to `params.output`.\nTies resolve to the earlier index, matching the GPU oracle."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "shader-dispatch",
      "title": "Shader Dispatch",
      "description": "Typed wrappers around the compute shaders that prepare push constants, descriptor layouts, and per-op dispatch dimensions.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#shader-dispatch",
      "module_count": 4,
      "symbol_count": 152,
      "modules": [
        {
          "slug": "attention",
          "title": "Attention",
          "section": "Shader Dispatch",
          "summary": "Wrap the flash-attention compute shader and its dispatch parameters.",
          "overview": [
            "This helper owns the pipeline resources needed to bind paged attention inputs and record a flash-attention compute pass."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/",
          "source_path": "src/compute/attention.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L15",
          "counts": {
            "code_lines": 220,
            "exports": 4,
            "methods": 6,
            "symbols": 10
          },
          "symbols": [
            {
              "name": "FlashAttnPush",
              "qualified_name": "FlashAttnPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FlashAttnPush = extern struct",
              "anchor": "flash-attn-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#flash-attn-push",
              "source_path": "src/compute/attention.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L15",
              "doc": {
                "summary": "Push constants for flash attention shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for flash attention shader."
              },
              "members": []
            },
            {
              "name": "FlashAttnBatchedPush",
              "qualified_name": "FlashAttnBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FlashAttnBatchedPush = extern struct",
              "anchor": "flash-attn-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#flash-attn-batched-push",
              "source_path": "src/compute/attention.zig",
              "source_line": 32,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L32",
              "doc": {
                "summary": "Push constants for flash_attn_batched.",
                "description": [
                  "Shared by two callers: - prefill batched path: processes N queries sharing a KV cache, seq_start is the position of the first query (0 on fresh prefill). - decode-shape foundation (ZINC_BATCH_ATTN=1): n_queries=1 with seq_start=state.position, bit-equivalent to the non-batched shader. sink_offset is the per-layer offset into the per-head sinks buffer (layer_idx * n_heads) — honoured by gpt-oss, NaN-gated otherwise."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for flash_attn_batched. Shared by two callers:\n- prefill batched path: processes N queries sharing a KV cache,\nseq_start is the position of the first query (0 on fresh prefill).\n- decode-shape foundation (ZINC_BATCH_ATTN=1): n_queries=1 with\nseq_start=state.position, bit-equivalent to the non-batched shader.\nsink_offset is the per-layer offset into the per-head sinks buffer\n(layer_idx * n_heads) — honoured by gpt-oss, NaN-gated otherwise."
              },
              "members": []
            },
            {
              "name": "FlashAttnSplitMergePush",
              "qualified_name": "FlashAttnSplitMergePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FlashAttnSplitMergePush = extern struct",
              "anchor": "flash-attn-split-merge-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#flash-attn-split-merge-push",
              "source_path": "src/compute/attention.zig",
              "source_line": 46,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L46",
              "doc": {
                "summary": "Push constants for flash_attn_split_merge.",
                "description": [
                  "Reads N_I_CHUNKS partial outputs per head from binding 0, applies the per-head sink, normalizes, writes the final output to binding 1."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for flash_attn_split_merge. Reads N_I_CHUNKS partial outputs\nper head from binding 0, applies the per-head sink, normalizes, writes the\nfinal output to binding 1."
              },
              "members": []
            },
            {
              "name": "AttentionDispatch",
              "qualified_name": "AttentionDispatch",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const AttentionDispatch = struct",
              "anchor": "attention-dispatch",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch",
              "source_path": "src/compute/attention.zig",
              "source_line": 58,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L58",
              "doc": {
                "summary": "Owns the Vulkan compute pipelines for flash attention and records their dispatches into a command buffer.",
                "description": [
                  "Supports three variants: single-query decode (`pipeline`), batched prefill/decode (`pipeline_batched`), and split-K decode (`pipeline_split` + `pipeline_split_merge`). The active variant is selected by the caller; all pipelines are loaded during `init` and destroyed by `deinit`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Owns the Vulkan compute pipelines for flash attention and records\ntheir dispatches into a command buffer. Supports three variants:\nsingle-query decode (`pipeline`), batched prefill/decode\n(`pipeline_batched`), and split-K decode (`pipeline_split` +\n`pipeline_split_merge`). The active variant is selected by the\ncaller; all pipelines are loaded during `init` and destroyed by `deinit`."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "AttentionDispatch.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( instance: *const Instance, shader_dir: []const u8, allocator: std.mem.Allocator, ) !AttentionDispatch",
                  "anchor": "attention-dispatch-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-init",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 81,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L81",
                  "doc": {
                    "summary": "Create the flash-attention dispatch wrapper and load its shader pipeline.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Directory containing compiled SPIR-V shader binaries."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary pipeline creation state."
                      }
                    ],
                    "returns": "An AttentionDispatch ready to record flash-attention passes.",
                    "notes": [],
                    "raw": "Create the flash-attention dispatch wrapper and load its shader pipeline."
                  }
                },
                {
                  "name": "recordFlashAttn",
                  "qualified_name": "AttentionDispatch.recordFlashAttn",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordFlashAttn( self: *const AttentionDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, n_kv_heads: u32, seq_len: u32, page_size: u32, attn_scale: f32, sink_offset: u32, ) !void",
                  "anchor": "attention-dispatch-record-flash-attn",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-record-flash-attn",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 204,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L204",
                  "doc": {
                    "summary": "Record a flash-attention dispatch for the current decode position.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the flash-attention pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set containing query, KV-cache, page-table, and output buffers."
                      },
                      {
                        "name": "head_dim",
                        "description": "Hidden width per attention head."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads to process."
                      },
                      {
                        "name": "n_kv_heads",
                        "description": "Number of KV heads present in the cache."
                      },
                      {
                        "name": "seq_len",
                        "description": "Current decoded sequence length."
                      },
                      {
                        "name": "page_size",
                        "description": "Tokens stored in each KV-cache page."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the flash-attention shader pipeline is unavailable.",
                    "notes": [
                      "The helper dispatches one workgroup per query head."
                    ],
                    "raw": "Record a flash-attention dispatch for the current decode position."
                  }
                },
                {
                  "name": "recordFlashAttnBatched",
                  "qualified_name": "AttentionDispatch.recordFlashAttnBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordFlashAttnBatched( self: *const AttentionDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, n_kv_heads: u32, seq_start: u32, n_queries: u32, page_size: u32, attn_scale: f32, sink_offset: u32, ) !void",
                  "anchor": "attention-dispatch-record-flash-attn-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-record-flash-attn-batched",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 255,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L255",
                  "doc": {
                    "summary": "Record a batched flash-attention dispatch.",
                    "description": [
                      "Grid is (n_heads, n_queries, 1); each (head, query) workgroup streams over the paged KV cache with causal_len = seq_start + query + 1."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the batched flash-attention pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with Q, KV-cache, page-table, output, and sink buffers."
                      },
                      {
                        "name": "head_dim",
                        "description": "Hidden width per attention head."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads to process."
                      },
                      {
                        "name": "n_kv_heads",
                        "description": "Number of KV heads in the cache (GQA ratio = n_heads / n_kv_heads)."
                      },
                      {
                        "name": "seq_start",
                        "description": "Token position of the first query in the sequence (0 on fresh prefill)."
                      },
                      {
                        "name": "n_queries",
                        "description": "Number of query tokens processed in this batch."
                      },
                      {
                        "name": "page_size",
                        "description": "Tokens stored per KV-cache page."
                      },
                      {
                        "name": "attn_scale",
                        "description": "Attention softmax scale factor (0 = use 1/sqrt(head_dim))."
                      },
                      {
                        "name": "sink_offset",
                        "description": "Per-layer offset into the sink buffer (layer_idx * n_heads)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the batched pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record a batched flash-attention dispatch.\nGrid is (n_heads, n_queries, 1); each (head, query) workgroup streams\nover the paged KV cache with causal_len = seq_start + query + 1."
                  }
                },
                {
                  "name": "recordFlashAttnSplit",
                  "qualified_name": "AttentionDispatch.recordFlashAttnSplit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordFlashAttnSplit( self: *const AttentionDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, n_kv_heads: u32, seq_len: u32, page_size: u32, attn_scale: f32, sink_offset: u32, ) !void",
                  "anchor": "attention-dispatch-record-flash-attn-split",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-record-flash-attn-split",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 298,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L298",
                  "doc": {
                    "summary": "Record the split-K flash attention dispatch (per-chunk partial pass).",
                    "description": [
                      "Grid: (n_heads, fa_split_k_active, 1). Each workgroup runs the standard flash_attn body scoped to its (head, chunk_id) i-range and writes (O_partial, M, L) to the partial output buffer bound at slot 4. Must be followed by `recordFlashAttnSplitMerge` to produce final output."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the split-K pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with Q, KV-cache, page-table, partial-output, and sink buffers."
                      },
                      {
                        "name": "head_dim",
                        "description": "Hidden width per attention head."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads to process."
                      },
                      {
                        "name": "n_kv_heads",
                        "description": "Number of KV heads in the cache (GQA ratio = n_heads / n_kv_heads)."
                      },
                      {
                        "name": "seq_len",
                        "description": "Current decoded sequence length (total KV entries to attend over)."
                      },
                      {
                        "name": "page_size",
                        "description": "Tokens stored per KV-cache page."
                      },
                      {
                        "name": "attn_scale",
                        "description": "Attention softmax scale factor (0 = use 1/sqrt(head_dim))."
                      },
                      {
                        "name": "sink_offset",
                        "description": "Per-layer offset into the sink buffer (layer_idx * n_heads)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the split-K pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record the split-K flash attention dispatch (per-chunk partial pass).\nGrid: (n_heads, fa_split_k_active, 1). Each workgroup runs the\nstandard flash_attn body scoped to its (head, chunk_id) i-range and\nwrites (O_partial, M, L) to the partial output buffer bound at slot 4.\nMust be followed by `recordFlashAttnSplitMerge` to produce final output."
                  }
                },
                {
                  "name": "recordFlashAttnSplitMerge",
                  "qualified_name": "AttentionDispatch.recordFlashAttnSplitMerge",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordFlashAttnSplitMerge( self: *const AttentionDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, sink_offset: u32, ) !void",
                  "anchor": "attention-dispatch-record-flash-attn-split-merge",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-record-flash-attn-split-merge",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 334,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L334",
                  "doc": {
                    "summary": "Record the split-K merge pass dispatch — combines per-chunk partials for each head, applies the per-head sink term, and writes the final normalized attention output.",
                    "description": [
                      "Grid: (n_heads, 1, 1). Must be called after `recordFlashAttnSplit` and a pipeline barrier."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the split-K merge pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with partial-input, final-output, and sink buffers (3 bindings)."
                      },
                      {
                        "name": "head_dim",
                        "description": "Hidden width per attention head."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads whose partials are to be merged."
                      },
                      {
                        "name": "sink_offset",
                        "description": "Per-layer offset into the sink buffer (layer_idx * n_heads)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the split-K merge pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record the split-K merge pass dispatch — combines per-chunk partials\nfor each head, applies the per-head sink term, and writes the final\nnormalized attention output. Grid: (n_heads, 1, 1).\nMust be called after `recordFlashAttnSplit` and a pipeline barrier."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "AttentionDispatch.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *AttentionDispatch) void",
                  "anchor": "attention-dispatch-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/attention/#attention-dispatch-deinit",
                  "source_path": "src/compute/attention.zig",
                  "source_line": 353,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/attention.zig#L353",
                  "doc": {
                    "summary": "Destroy the loaded pipeline and descriptor pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the loaded pipeline and descriptor pool."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "dmmv",
          "title": "DMMV",
          "section": "Shader Dispatch",
          "summary": "Wrap the decode-time matrix-vector shader family used for projection ops.",
          "overview": [
            "This helper selects quantization-specific DMMV pipelines and records the push constants and workgroup sizes needed for single-token decode."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/",
          "source_path": "src/compute/dmmv.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L21",
          "counts": {
            "code_lines": 5142,
            "exports": 25,
            "methods": 55,
            "symbols": 80
          },
          "symbols": [
            {
              "name": "DmmvPushConstants",
              "qualified_name": "DmmvPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvPushConstants = extern struct",
              "anchor": "dmmv-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L21",
              "doc": {
                "summary": "Push constants for DMMV shaders (must match GLSL layout).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for DMMV shaders (must match GLSL layout)."
              },
              "members": []
            },
            {
              "name": "BatchDmmvPushConstants",
              "qualified_name": "BatchDmmvPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BatchDmmvPushConstants = extern struct",
              "anchor": "batch-dmmv-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#batch-dmmv-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 40,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L40",
              "doc": {
                "summary": "Push constants for batch DMMV shaders (prefill: multiple columns).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for batch DMMV shaders (prefill: multiple columns)."
              },
              "members": []
            },
            {
              "name": "MoeDmmvPushConstants",
              "qualified_name": "MoeDmmvPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeDmmvPushConstants = extern struct",
              "anchor": "moe-dmmv-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-dmmv-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 51,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L51",
              "doc": {
                "summary": "Push constants for MoE DMMV shaders (must match GLSL layout).",
                "description": [
                  "Batched expert dispatch: workgroup Y dimension selects expert slot."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for MoE DMMV shaders (must match GLSL layout).\nBatched expert dispatch: workgroup Y dimension selects expert slot."
              },
              "members": []
            },
            {
              "name": "MoeBatchedDmmvPushConstants",
              "qualified_name": "MoeBatchedDmmvPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeBatchedDmmvPushConstants = extern struct",
              "anchor": "moe-batched-dmmv-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-batched-dmmv-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 64,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L64",
              "doc": {
                "summary": "Push constants for the cross-token batched MoE DMMV (src/shaders/dmmv_q4k_moe_batched.comp).",
                "description": [
                  "Each WG handles one (row_pair, expert_slot, token_idx) triple; the routing buffer is flattened [n_tokens × n_experts_used] of expert IDs."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the cross-token batched MoE DMMV\n(src/shaders/dmmv_q4k_moe_batched.comp). Each WG handles one\n(row_pair, expert_slot, token_idx) triple; the routing buffer is\nflattened [n_tokens × n_experts_used] of expert IDs."
              },
              "members": []
            },
            {
              "name": "MoeColsDmmvPushConstants",
              "qualified_name": "MoeColsDmmvPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeColsDmmvPushConstants = extern struct",
              "anchor": "moe-cols-dmmv-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-cols-dmmv-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 74,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L74",
              "doc": {
                "summary": "Push constants for grouped route-column MoE DMMV shaders.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for grouped route-column MoE DMMV shaders."
              },
              "members": []
            },
            {
              "name": "MoeFusedDownAccPushConstants",
              "qualified_name": "MoeFusedDownAccPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeFusedDownAccPushConstants = extern struct",
              "anchor": "moe-fused-down-acc-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-fused-down-acc-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 99,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L99",
              "doc": {
                "summary": "Push constants for the fused MoE down + weighted_acc shader (src/shaders/dmmv_q4k_moe_fused_down_acc.comp).",
                "description": [
                  "Same layout as MoeDmmvPushConstants plus n_used (the expert loop is internal to the shader so the dispatch grid drops the Y=n_experts_used dim)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the fused MoE down + weighted_acc shader\n(src/shaders/dmmv_q4k_moe_fused_down_acc.comp). Same layout as\nMoeDmmvPushConstants plus n_used (the expert loop is internal to\nthe shader so the dispatch grid drops the Y=n_experts_used dim)."
              },
              "members": []
            },
            {
              "name": "MoeGateUpGegluPushConstants",
              "qualified_name": "MoeGateUpGegluPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeGateUpGegluPushConstants = extern struct",
              "anchor": "moe-gate-up-geglu-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-gate-up-geglu-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 113,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L113",
              "doc": {
                "summary": "Push constants for Gemma's packed Q4_K MoE gate+up+GEGLU shader.",
                "description": [
                  "The shader reads expert ids from the routing buffer, so `expert_stride` spans the full packed gate+up expert and `up_offset` selects the up half."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for Gemma's packed Q4_K MoE gate+up+GEGLU shader.\nThe shader reads expert ids from the routing buffer, so `expert_stride`\nspans the full packed gate+up expert and `up_offset` selects the up half."
              },
              "members": []
            },
            {
              "name": "GemmaTop1MoeBatchPushConstants",
              "qualified_name": "GemmaTop1MoeBatchPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GemmaTop1MoeBatchPushConstants = extern struct",
              "anchor": "gemma-top1-moe-batch-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#gemma-top1-moe-batch-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 123,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L123",
              "doc": {
                "summary": "Push constants for Gemma short-prefill token-batched top-1 MoE shaders.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for Gemma short-prefill token-batched top-1 MoE shaders."
              },
              "members": []
            },
            {
              "name": "GemmaTop1GateUpColsPushConstants",
              "qualified_name": "GemmaTop1GateUpColsPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GemmaTop1GateUpColsPushConstants = extern struct",
              "anchor": "gemma-top1-gate-up-cols-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#gemma-top1-gate-up-cols-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 132,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L132",
              "doc": {
                "summary": "Push constants for route-packed Gemma short-prefill top-1 gate/up+GEGLU.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for route-packed Gemma short-prefill top-1 gate/up+GEGLU."
              },
              "members": []
            },
            {
              "name": "OprojMergePushConstants",
              "qualified_name": "OprojMergePushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const OprojMergePushConstants = extern struct",
              "anchor": "oproj-merge-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#oproj-merge-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 149,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L149",
              "doc": {
                "summary": "Push constants for the fused split-K merge + o_proj DMMV-acc shader (src/shaders/dmmv_q4k_o_proj_merge.comp).",
                "description": [
                  "Adds the merge-pass parameters to the standard DmmvPushConstants so a single dispatch reads partials, computes per-head LSE merge weights, stages attn_out into LDS, and runs the Q4_K matmul with residual accumulation."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the fused split-K merge + o_proj DMMV-acc shader\n(src/shaders/dmmv_q4k_o_proj_merge.comp). Adds the merge-pass parameters\nto the standard DmmvPushConstants so a single dispatch reads partials,\ncomputes per-head LSE merge weights, stages attn_out into LDS, and runs\nthe Q4_K matmul with residual accumulation."
              },
              "members": []
            },
            {
              "name": "DmmvSigmoidAccPushConstants",
              "qualified_name": "DmmvSigmoidAccPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvSigmoidAccPushConstants = extern struct",
              "anchor": "dmmv-sigmoid-acc-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-sigmoid-acc-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 167,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L167",
              "doc": {
                "summary": "Push constants for the fused Q8_0 DMMV + sigmoid-gated scale-accumulate shader (src/shaders/dmmv_q8_0_sigmoid_acc.comp).",
                "description": [
                  "Same prefix as DmmvPushConstants but `acc_mode` is replaced by `gate_offset` (the shader always accumulates and always sigmoid-gates; gate_offset selects which f32 in the gate buffer holds the shexp_gate scalar — typically 0)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the fused Q8_0 DMMV + sigmoid-gated scale-accumulate\nshader (src/shaders/dmmv_q8_0_sigmoid_acc.comp). Same prefix as\nDmmvPushConstants but `acc_mode` is replaced by `gate_offset` (the\nshader always accumulates and always sigmoid-gates; gate_offset selects\nwhich f32 in the gate buffer holds the shexp_gate scalar — typically 0)."
              },
              "members": []
            },
            {
              "name": "DmmvGateUpGegluPushConstants",
              "qualified_name": "DmmvGateUpGegluPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvGateUpGegluPushConstants = extern struct",
              "anchor": "dmmv-gate-up-geglu-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-gate-up-geglu-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 179,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L179",
              "doc": {
                "summary": "Push constants for the Gemma CPU-MoE fused gate+up+GEGLU shader.",
                "description": [
                  "Gate/up offsets are byte offsets into the same packed Q4_K expert tensor; x/y offsets follow the standard DMMV byte convention."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the Gemma CPU-MoE fused gate+up+GEGLU shader.\nGate/up offsets are byte offsets into the same packed Q4_K expert tensor;\nx/y offsets follow the standard DMMV byte convention."
              },
              "members": []
            },
            {
              "name": "DmmvScaleAccPushConstants",
              "qualified_name": "DmmvScaleAccPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvScaleAccPushConstants = extern struct",
              "anchor": "dmmv-scale-acc-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-scale-acc-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 189,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L189",
              "doc": {
                "summary": "Push constants for quantized DMMV fused with `y += scale * dot(W, x)`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for quantized DMMV fused with `y += scale * dot(W, x)`."
              },
              "members": []
            },
            {
              "name": "DmmvQ8PairPushConstants",
              "qualified_name": "DmmvQ8PairPushConstants",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvQ8PairPushConstants = extern struct",
              "anchor": "dmmv-q8-pair-push-constants",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-q8-pair-push-constants",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 200,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L200",
              "doc": {
                "summary": "Push constants for the fused Q8_0 pair DMMV shader.",
                "description": [
                  "Computes two independent Q8_0 matvecs that share one F32 input vector."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the fused Q8_0 pair DMMV shader. Computes two\nindependent Q8_0 matvecs that share one F32 input vector."
              },
              "members": []
            },
            {
              "name": "QuantizeQ8_1Push",
              "qualified_name": "QuantizeQ8_1Push",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const QuantizeQ8_1Push = extern struct",
              "anchor": "quantize-q8-1-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#quantize-q8-1-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 214,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L214",
              "doc": {
                "summary": "Push constants for the quantize_q8_1 shader.",
                "description": [
                  "`ne` = number of f32 input elements (must be a multiple of 32). `num_blocks` = ne / 32. Pass explicitly so the shader does not have to divide."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the quantize_q8_1 shader.\n`ne` = number of f32 input elements (must be a multiple of 32).\n`num_blocks` = ne / 32. Pass explicitly so the shader does not have to divide."
              },
              "members": []
            },
            {
              "name": "CountExpertsPush",
              "qualified_name": "CountExpertsPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CountExpertsPush = extern struct",
              "anchor": "count-experts-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#count-experts-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 232,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L232",
              "doc": {
                "summary": "Push constants for `count_experts.comp` (effort-6 Step 3 helper). Mirrors the reference implementation's count_experts push so the shader is structurally identical to the upstream version. All strides are in u32 units (not bytes).",
                "description": [
                  "For the prefill routing capture buffer with layout slot(token, layer) = (token * n_layers + layer) * (2 * n_experts_used) where the first n_experts_used u32s are expert IDs and the second n_experts_used u32s are f32 weights, configure as: ne00 = n_experts_used (cells per token row) ne01 = n_tokens (number of token rows) nb00 = 1 (consecutive within slot) nb01 = 2 * n_experts_used * n_layers (skip n_layers slots per row step) a_offset = layer * 2 * n_experts_used (jump to layer's slot in token 0)"
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for `count_experts.comp` (effort-6 Step 3 helper). Mirrors\nthe reference implementation's count_experts push so the shader is structurally identical\nto the upstream version. All strides are in u32 units (not bytes).\n\nFor the prefill routing capture buffer with layout\nslot(token, layer) = (token * n_layers + layer) * (2 * n_experts_used)\nwhere the first n_experts_used u32s are expert IDs and the second\nn_experts_used u32s are f32 weights, configure as:\nne00 = n_experts_used                (cells per token row)\nne01 = n_tokens                      (number of token rows)\nnb00 = 1                             (consecutive within slot)\nnb01 = 2 * n_experts_used * n_layers (skip n_layers slots per row step)\na_offset = layer * 2 * n_experts_used (jump to layer's slot in token 0)"
              },
              "members": []
            },
            {
              "name": "MoeRoutePackPush",
              "qualified_name": "MoeRoutePackPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeRoutePackPush = extern struct",
              "anchor": "moe-route-pack-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#moe-route-pack-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 243,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L243",
              "doc": {
                "summary": "Push constants for `moe_route_pack` — turns per-token expert routing into expert-grouped work lists (per-expert counts, packed token IDs, the active-block list, and the indirect dispatch args consumed by the MoE columns kernels).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for `moe_route_pack` — turns per-token expert routing into\nexpert-grouped work lists (per-expert counts, packed token IDs, the active-block\nlist, and the indirect dispatch args consumed by the MoE columns kernels)."
              },
              "members": []
            },
            {
              "name": "MulMmQ4KPush",
              "qualified_name": "MulMmQ4KPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MulMmQ4KPush = extern struct",
              "anchor": "mul-mm-q4-kpush",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#mul-mm-q4-kpush",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 261,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L261",
              "doc": {
                "summary": "Push constants for `mul_mm_q4k.comp` (effort-6 Step 1 of 5 foundation: tiled Q4_K dense GEMM).",
                "description": [
                  "Mirrors the dispatch-side argument shape needed to address an M×K Q4_K weight tensor against a K×N f32 activation tile. All offsets follow the existing dmmv convention: `a_offset` is in BYTES (the shader divides by 4 to index a_u32[]), `b_offset` and `d_offset` are in FLOATS. Layout for B/D is column-major: B[col][k] = data_b[b_offset + col*stride_b + k]."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for `mul_mm_q4k.comp` (effort-6 Step 1 of 5 foundation:\ntiled Q4_K dense GEMM). Mirrors the dispatch-side argument shape needed\nto address an M×K Q4_K weight tensor against a K×N f32 activation tile.\nAll offsets follow the existing dmmv convention:\n`a_offset` is in BYTES (the shader divides by 4 to index a_u32[]),\n`b_offset` and `d_offset` are in FLOATS.\nLayout for B/D is column-major: B[col][k] = data_b[b_offset + col*stride_b + k]."
              },
              "members": []
            },
            {
              "name": "MulMmIdQ4KPush",
              "qualified_name": "MulMmIdQ4KPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MulMmIdQ4KPush = extern struct",
              "anchor": "mul-mm-id-q4-kpush",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#mul-mm-id-q4-kpush",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 277,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L277",
              "doc": {
                "summary": "Push constants for `mul_mm_id_q4k.comp`, the routed MoE gather sibling of `MulMmQ4KPush`.",
                "description": [
                  "Offsets follow existing GEMM conventions: `a_offset` and `batch_stride_a` are bytes, `b_offset`, `d_offset`, `stride_b`, `stride_d`, and `batch_stride_d` are f32 elements, and `ids_offset` is in u32 elements."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for `mul_mm_id_q4k.comp`, the routed MoE gather sibling\nof `MulMmQ4KPush`. Offsets follow existing GEMM conventions: `a_offset`\nand `batch_stride_a` are bytes, `b_offset`, `d_offset`, `stride_b`,\n`stride_d`, and `batch_stride_d` are f32 elements, and `ids_offset` is\nin u32 elements."
              },
              "members": []
            },
            {
              "name": "MulMmQ6KDp4aPush",
              "qualified_name": "MulMmQ6KDp4aPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MulMmQ6KDp4aPush = extern struct",
              "anchor": "mul-mm-q6-kdp4a-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#mul-mm-q6-kdp4a-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 294,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L294",
              "doc": {
                "summary": "Push constants for the int8 DP4a full-tile Q6_K dense-down GEMM.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the int8 DP4a full-tile Q6_K dense-down GEMM."
              },
              "members": []
            },
            {
              "name": "QuantizeActPush",
              "qualified_name": "QuantizeActPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const QuantizeActPush = extern struct",
              "anchor": "quantize-act-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#quantize-act-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 306,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L306",
              "doc": {
                "summary": "Push constants for the one-shot per-32-block activation int8 quantizer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the one-shot per-32-block activation int8 quantizer."
              },
              "members": []
            },
            {
              "name": "MulMmQ4KGateUpDp4aPush",
              "qualified_name": "MulMmQ4KGateUpDp4aPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MulMmQ4KGateUpDp4aPush = extern struct",
              "anchor": "mul-mm-q4-kgate-up-dp4a-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#mul-mm-q4-kgate-up-dp4a-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 316,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L316",
              "doc": {
                "summary": "Push constants for the int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM.",
                "description": [
                  "Same fields as `MulMmQ6KDp4aPush` but `stride_b_scale` counts vec2 entries (one per 32-block) so the shader can fetch (scale, dsum) in one read."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM.\nSame fields as `MulMmQ6KDp4aPush` but `stride_b_scale` counts vec2 entries\n(one per 32-block) so the shader can fetch (scale, dsum) in one read."
              },
              "members": []
            },
            {
              "name": "MulMmQ4KGateUpDp4aQ8Push",
              "qualified_name": "MulMmQ4KGateUpDp4aQ8Push",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MulMmQ4KGateUpDp4aQ8Push = extern struct",
              "anchor": "mul-mm-q4-kgate-up-dp4a-q8-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#mul-mm-q4-kgate-up-dp4a-q8-push",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 330,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L330",
              "doc": {
                "summary": "Push constants for the int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM that emits Q8_0-style packed activations directly (fused SwiGLU + quantize for the Qwen3.6-27B dense-down DP4a path).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM that\nemits Q8_0-style packed activations directly (fused SwiGLU + quantize for\nthe Qwen3.6-27B dense-down DP4a path)."
              },
              "members": []
            },
            {
              "name": "Q8_1_BLOCK_BYTES",
              "qualified_name": "Q8_1_BLOCK_BYTES",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Q8_1_BLOCK_BYTES: u32 = 36",
              "anchor": "q8-1-block-bytes",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#q8-1-block-bytes",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 346,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L346",
              "doc": {
                "summary": "Size in bytes of a single Q8_1 output block (32 int8 values + f16 d + f16 d*sum).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Size in bytes of a single Q8_1 output block (32 int8 values + f16 d + f16 d*sum)."
              },
              "members": []
            },
            {
              "name": "DmmvDispatch",
              "qualified_name": "DmmvDispatch",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DmmvDispatch = struct",
              "anchor": "dmmv-dispatch",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch",
              "source_path": "src/compute/dmmv.zig",
              "source_line": 349,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L349",
              "doc": {
                "summary": "Manages DMMV pipelines for different quantization types.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Manages DMMV pipelines for different quantization types."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "DmmvDispatch.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( instance: *const Instance, gpu_config: *const GpuConfig, shader_dir: []const u8, hidden_dim: u32, allocator: std.mem.Allocator, ) !DmmvDispatch",
                  "anchor": "dmmv-dispatch-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-init",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 849,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L849",
                  "doc": {
                    "summary": "Create the DMMV dispatch wrapper and load the supported quantized pipelines.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "gpu_config",
                        "description": "Derived GPU tuning parameters (wave size, push-descriptor support)."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Directory containing compiled SPIR-V shader binaries (`.spv` files)."
                      },
                      {
                        "name": "hidden_dim",
                        "description": "Maximum K value used by the Q4_K and F32 shaders' shared-memory array; must be >= hidden_dim, inter_dim, q_dim, and d_inner."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary pipeline creation state."
                      }
                    ],
                    "returns": "A fully-initialised DmmvDispatch ready to record projection work; missing shaders are silently set to null.",
                    "notes": [],
                    "raw": "Create the DMMV dispatch wrapper and load the supported quantized pipelines."
                  }
                },
                {
                  "name": "pipelineForType",
                  "qualified_name": "DmmvDispatch.pipelineForType",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn pipelineForType(self: *const DmmvDispatch, quant_type: GGMLType) ?*const Pipeline",
                  "anchor": "dmmv-dispatch-pipeline-for-type",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-pipeline-for-type",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2529,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2529",
                  "doc": {
                    "summary": "Select the quantization-specific pipeline used for a weight matrix format.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the loaded DMMV pipelines."
                      },
                      {
                        "name": "quant_type",
                        "description": "GGML quantization format for the weight matrix."
                      }
                    ],
                    "returns": "A pipeline pointer when that quantization format has a loaded shader implementation.",
                    "notes": [
                      "Unsupported or unloaded formats return `null` so callers can surface `error.UnsupportedQuantType`."
                    ],
                    "raw": "Select the quantization-specific pipeline used for a weight matrix format."
                  }
                },
                {
                  "name": "moePipelineForType",
                  "qualified_name": "DmmvDispatch.moePipelineForType",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn moePipelineForType(self: *const DmmvDispatch, quant_type: GGMLType) ?*const Pipeline",
                  "anchor": "dmmv-dispatch-moe-pipeline-for-type",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-moe-pipeline-for-type",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2548,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2548",
                  "doc": {
                    "summary": "Select the MoE-specific pipeline for the given weight format (4 bindings: A, x, y, routing).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the loaded DMMV pipelines."
                      },
                      {
                        "name": "quant_type",
                        "description": "GGML quantization format for the MoE expert weight matrix."
                      }
                    ],
                    "returns": "A pipeline pointer when a MoE shader is loaded for the format, or null for unsupported types.",
                    "notes": [],
                    "raw": "Select the MoE-specific pipeline for the given weight format (4 bindings: A, x, y, routing)."
                  }
                },
                {
                  "name": "recordMoeDispatch",
                  "qualified_name": "DmmvDispatch.recordMoeDispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeDispatch( self: *const DmmvDispatch, cmd: *CommandBuffer, quant_type: GGMLType, descriptor_set: vk.c.VkDescriptorSet, M: u32, K: u32, expert_stride: u32, n_experts_y: u32, x_expert_stride: u32, x_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-dispatch",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2571,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2571",
                  "doc": {
                    "summary": "Record a batched MoE DMMV dispatch where all experts run in parallel via Y workgroups.",
                    "description": [],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record into."
                      },
                      {
                        "name": "quant_type",
                        "description": "Weight quantization; resolved via `moePipelineForType`."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with bindings A, x, y, routing."
                      },
                      {
                        "name": "M",
                        "description": "Output rows (weight rows per expert)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width (shared across all experts)."
                      },
                      {
                        "name": "expert_stride",
                        "description": "Byte stride between consecutive experts in the stacked weight tensor."
                      },
                      {
                        "name": "n_experts_y",
                        "description": "Number of experts to process; becomes the Y workgroup dimension."
                      },
                      {
                        "name": "x_expert_stride",
                        "description": "Element stride between consecutive experts' input vectors (0 = shared input; K = per-expert)."
                      },
                      {
                        "name": "x_offset",
                        "description": "Element offset into the input buffer."
                      },
                      {
                        "name": "y_offset",
                        "description": "Element offset into the output buffer."
                      }
                    ],
                    "returns": "`error.UnsupportedQuantType` when no MoE pipeline is loaded for `quant_type`.",
                    "notes": [],
                    "raw": "Record a batched MoE DMMV dispatch where all experts run in parallel via Y workgroups."
                  }
                },
                {
                  "name": "recordMoeBatchedDispatch",
                  "qualified_name": "DmmvDispatch.recordMoeBatchedDispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeBatchedDispatch( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, routing_buf: vk.c.VkBuffer, routing_size: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, n_experts_used: u32, n_tokens: u32, x_token_stride: u32, y_token_stride: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-batched-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-batched-dispatch",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2608,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2608",
                  "doc": {
                    "summary": "Record a cross-token batched MoE DMMV dispatch.",
                    "description": [
                      "Reads N tokens' inputs from `X_batch[N × K]`, dispatches one WG per (row_pair, expert_slot, token_idx), routes via flattened `routing[N × n_experts_used]`, writes to `Y_batch[N × n_experts_used × M]`. Q4_K only for now."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a cross-token batched MoE DMMV dispatch. Reads N tokens'\ninputs from `X_batch[N × K]`, dispatches one WG per (row_pair,\nexpert_slot, token_idx), routes via flattened\n`routing[N × n_experts_used]`, writes to\n`Y_batch[N × n_experts_used × M]`. Q4_K only for now."
                  }
                },
                {
                  "name": "recordMoeRoutePack",
                  "qualified_name": "DmmvDispatch.recordMoeRoutePack",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeRoutePack( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, routing_buf: vk.c.VkBuffer, routing_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_count_buf: vk.c.VkBuffer, active_count_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, dispatch_args_buf: vk.c.VkBuffer, dispatch_args_size: vk.c.VkDeviceSize, n_tokens: u32, n_experts: u32, k: u32, routing_stride: u32, ids_stride: u32, gate_up_workgroups_x: u32, down_workgroups_x: u32, routing_token_base: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-route-pack",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-route-pack",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2674,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2674",
                  "doc": {
                    "summary": "Record the single-workgroup `moe_route_pack` dispatch that compacts per-token expert routing into expert-grouped work lists for the MoE columns kernels.",
                    "description": [
                      "Reads `routing_buf`/`ids_buf` and writes the per-expert `counts_buf`, the packed `active_blocks_buf` + `active_count_buf`, and `dispatch_args_buf` for the subsequent indirect MoE dispatch. Each buffer is paired with its byte size. `error.InvalidArgument` on a zero token/expert/k/stride/workgroup count."
                    ],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record into."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Optional push-descriptor function (null uses bound descriptor sets)."
                      },
                      {
                        "name": "n_tokens",
                        "description": "Number of tokens being routed."
                      },
                      {
                        "name": "n_experts",
                        "description": "Total expert count in the layer."
                      },
                      {
                        "name": "k",
                        "description": "Experts selected per token (top-k)."
                      },
                      {
                        "name": "routing_stride",
                        "description": "Per-token stride (elements) into the routing buffer."
                      },
                      {
                        "name": "ids_stride",
                        "description": "Per-token stride into the packed IDs buffer."
                      },
                      {
                        "name": "gate_up_workgroups_x",
                        "description": "Workgroups-X to encode into the gate/up columns dispatch args."
                      },
                      {
                        "name": "down_workgroups_x",
                        "description": "Workgroups-X to encode into the down columns dispatch args."
                      },
                      {
                        "name": "routing_token_base",
                        "description": "First token offset within the routing buffer."
                      }
                    ],
                    "returns": "`error.PipelineNotLoaded` if the route-pack pipeline is absent, or",
                    "notes": [],
                    "raw": "Record the single-workgroup `moe_route_pack` dispatch that compacts per-token\nexpert routing into expert-grouped work lists for the MoE columns kernels.\n\nReads `routing_buf`/`ids_buf` and writes the per-expert `counts_buf`, the packed\n`active_blocks_buf` + `active_count_buf`, and `dispatch_args_buf` for the\nsubsequent indirect MoE dispatch. Each buffer is paired with its byte size.\n`error.InvalidArgument` on a zero token/expert/k/stride/workgroup count."
                  }
                },
                {
                  "name": "recordMoeColsDispatchIndirect",
                  "qualified_name": "DmmvDispatch.recordMoeColsDispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeColsDispatchIndirect( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, quant_type: GGMLType, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, indirect_buf: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, ids_stride: u32, x_route_divisor: u32, a_offset: u32, x_offset: u32, y_offset: u32, accumulate: bool, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-cols-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-cols-dispatch-indirect",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2750,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2750",
                  "doc": {
                    "summary": "Record an **indirect** MoE columns DMMV — the per-expert weight×activation matvec whose workgroup count is read from `indirect_buf` rather than the host.",
                    "description": [
                      "Indirect form: the active-block count is GPU-resident (produced by `recordMoeRoutePack`), so the host never stalls on a readback. Each buffer is paired with its byte size. `error.InvalidArgument` on zero M/K/ids_stride or incompatible K alignment."
                    ],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record into."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Optional push-descriptor function (null uses bound descriptor sets)."
                      },
                      {
                        "name": "quant_type",
                        "description": "Weight quantization; supports K-quant columns plus Gemma Q5_1 down rows."
                      },
                      {
                        "name": "indirect_buf",
                        "description": "Buffer holding the `VkDispatchIndirectCommand` workgroup dims."
                      },
                      {
                        "name": "indirect_offset",
                        "description": "Byte offset of the dispatch args within `indirect_buf`."
                      },
                      {
                        "name": "M",
                        "description": "Output rows (expert weight rows)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width; must be a multiple of 256."
                      },
                      {
                        "name": "expert_stride",
                        "description": "Per-expert stride (elements) into the weight buffer."
                      },
                      {
                        "name": "ids_stride",
                        "description": "Per-token stride into the packed IDs buffer."
                      },
                      {
                        "name": "x_route_divisor",
                        "description": "Divisor mapping output rows back to source activation rows."
                      },
                      {
                        "name": "accumulate",
                        "description": "When true, add into `y_buf` instead of overwriting it."
                      }
                    ],
                    "returns": "`error.UnsupportedQuantType` for unsupported weights, or",
                    "notes": [],
                    "raw": "Record an **indirect** MoE columns DMMV — the per-expert weight×activation\nmatvec whose workgroup count is read from `indirect_buf` rather than the host.\n\nIndirect form: the active-block count is GPU-resident (produced by\n`recordMoeRoutePack`), so the host never stalls on a readback. Each buffer is\npaired with its byte size.\n`error.InvalidArgument` on zero M/K/ids_stride or incompatible K alignment."
                  }
                },
                {
                  "name": "recordMoeColsQ8_1DispatchIndirect",
                  "qualified_name": "DmmvDispatch.recordMoeColsQ8_1DispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeColsQ8_1DispatchIndirect( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, quant_type: GGMLType, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_packed_buf: vk.c.VkBuffer, x_packed_size: vk.c.VkDeviceSize, x_scale_dsum_buf: vk.c.VkBuffer, x_scale_dsum_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, indirect_buf: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, ids_stride: u32, x_route_divisor: u32, a_offset: u32, x_offset: u32, y_offset: u32, accumulate: bool, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-cols-q8-1-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-cols-q8-1-dispatch-indirect",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2817,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2817",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordGemmaTop1GateUpGegluColsDispatchIndirect",
                  "qualified_name": "DmmvDispatch.recordGemmaTop1GateUpGegluColsDispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordGemmaTop1GateUpGegluColsDispatchIndirect( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, indirect_buf: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, up_offset: u32, ids_stride: u32, x_route_divisor: u32, a_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-gemma-top1-gate-up-geglu-cols-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-gemma-top1-gate-up-geglu-cols-dispatch-indirect",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2885,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2885",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordQwenTop1GateUpSwigluColsDispatchIndirect",
                  "qualified_name": "DmmvDispatch.recordQwenTop1GateUpSwigluColsDispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordQwenTop1GateUpSwigluColsDispatchIndirect( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, indirect_buf: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, ids_stride: u32, x_route_divisor: u32, x_token_base: u32, a_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-qwen-top1-gate-up-swiglu-cols-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-qwen-top1-gate-up-swiglu-cols-dispatch-indirect",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 2944,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L2944",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordQwenTop1GateUpSwigluColsQ8_1DispatchIndirect",
                  "qualified_name": "DmmvDispatch.recordQwenTop1GateUpSwigluColsQ8_1DispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordQwenTop1GateUpSwigluColsQ8_1DispatchIndirect( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, x_packed_buf: vk.c.VkBuffer, x_packed_size: vk.c.VkDeviceSize, x_scale_dsum_buf: vk.c.VkBuffer, x_scale_dsum_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, indirect_buf: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, ids_stride: u32, x_route_divisor: u32, x_token_base: u32, a_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-qwen-top1-gate-up-swiglu-cols-q8-1-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-qwen-top1-gate-up-swiglu-cols-q8-1-dispatch-indirect",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3006,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3006",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordMoeColsDispatch",
                  "qualified_name": "DmmvDispatch.recordMoeColsDispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeColsDispatch( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, quant_type: GGMLType, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, active_blocks_buf: vk.c.VkBuffer, active_blocks_size: vk.c.VkDeviceSize, M: u32, K: u32, expert_stride: u32, active_block_count: u32, ids_stride: u32, x_route_divisor: u32, a_offset: u32, x_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-moe-cols-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-moe-cols-dispatch",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3088,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3088",
                  "doc": {
                    "summary": "Record a **direct** MoE columns DMMV using a host-known `active_block_count` (the non-indirect sibling of `recordMoeColsDispatchIndirect`).",
                    "description": [
                      "Prefer this when the active block count is already known on the CPU; otherwise use the indirect form to avoid a GPU→CPU readback. This variant always overwrites `y_buf` (no accumulate). Each buffer is paired with its byte size. `error.InvalidArgument` on zero M/K/active_block_count/ids_stride or incompatible K alignment."
                    ],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record into."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Optional push-descriptor function (null uses bound descriptor sets)."
                      },
                      {
                        "name": "quant_type",
                        "description": "Weight quantization; supports route-packed K-quant columns plus Gemma Q5_1 down rows."
                      },
                      {
                        "name": "M",
                        "description": "Output rows (expert weight rows)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width; must match the quantization block alignment."
                      },
                      {
                        "name": "expert_stride",
                        "description": "Per-expert stride (elements) into the weight buffer."
                      },
                      {
                        "name": "active_block_count",
                        "description": "Number of active expert blocks to dispatch (workgroups-Y)."
                      },
                      {
                        "name": "ids_stride",
                        "description": "Per-token stride into the packed IDs buffer."
                      },
                      {
                        "name": "x_route_divisor",
                        "description": "Divisor mapping output rows back to source activation rows."
                      }
                    ],
                    "returns": "`error.UnsupportedQuantType` for unsupported weights, or",
                    "notes": [],
                    "raw": "Record a **direct** MoE columns DMMV using a host-known `active_block_count`\n(the non-indirect sibling of `recordMoeColsDispatchIndirect`).\n\nPrefer this when the active block count is already known on the CPU; otherwise\nuse the indirect form to avoid a GPU→CPU readback. This variant always\noverwrites `y_buf` (no accumulate). Each buffer is paired with its byte size.\n`error.InvalidArgument` on zero M/K/active_block_count/ids_stride or incompatible K alignment."
                  }
                },
                {
                  "name": "recordDispatch",
                  "qualified_name": "DmmvDispatch.recordDispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordDispatch( self: *const DmmvDispatch, cmd: *CommandBuffer, quant_type: GGMLType, descriptor_set: vk.c.VkDescriptorSet, M: u32, K: u32, a_offset: u32, x_offset: u32, y_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-dispatch",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3166,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3166",
                  "doc": {
                    "summary": "Record a decode-time matrix-vector multiply dispatch.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the quantization-specific pipelines."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "quant_type",
                        "description": "GGML quantization format for the weight matrix."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set containing matrix, input vector, and output buffers."
                      },
                      {
                        "name": "M",
                        "description": "Output row count."
                      },
                      {
                        "name": "K",
                        "description": "Input feature width."
                      },
                      {
                        "name": "a_offset",
                        "description": "Byte offset for the weight matrix."
                      },
                      {
                        "name": "x_offset",
                        "description": "Byte offset for the input vector."
                      },
                      {
                        "name": "y_offset",
                        "description": "Byte offset for the output vector."
                      }
                    ],
                    "returns": "`error.UnsupportedQuantType` when no pipeline is available for `quant_type`.",
                    "notes": [
                      "The helper uses one workgroup per 2 output rows for most quantized formats."
                    ],
                    "raw": "Record a decode-time matrix-vector multiply dispatch."
                  }
                },
                {
                  "name": "recordBatchDispatchPush",
                  "qualified_name": "DmmvDispatch.recordBatchDispatchPush",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordBatchDispatchPush( self: *const DmmvDispatch, cmd: *CommandBuffer, quant_type: GGMLType, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, x_buf: vk.c.VkBuffer, x_size: vk.c.VkDeviceSize, y_buf: vk.c.VkBuffer, y_size: vk.c.VkDeviceSize, M: u32, K: u32, a_offset: u32, x_offset: u32, y_offset: u32, num_cols: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-batch-dispatch-push",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-batch-dispatch-push",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3246,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3246",
                  "doc": {
                    "summary": "Record a push-descriptor batch DMMV dispatch covering `num_cols` token columns.",
                    "description": [
                      "Bindings: 0 = A weight matrix, 1 = X_batch (K × num_cols, column-major), 2 = Y_batch (M × num_cols, column-major)."
                    ],
                    "params": [
                      {
                        "name": "cmd",
                        "description": "Command buffer to record into."
                      },
                      {
                        "name": "quant_type",
                        "description": "Weight quantization; only Q4_K and Q6_K batch shaders are supported."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Push-descriptor function pointer (null falls back to bound descriptor sets)."
                      },
                      {
                        "name": "M",
                        "description": "Output row count (weight matrix rows)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width (hidden dimension)."
                      },
                      {
                        "name": "num_cols",
                        "description": "Number of token columns to process in this batch."
                      }
                    ],
                    "returns": "`error.UnsupportedQuantType` if no batch shader is loaded for `quant_type`.",
                    "notes": [],
                    "raw": "Record a push-descriptor batch DMMV dispatch covering `num_cols` token columns.\nBindings: 0 = A weight matrix, 1 = X_batch (K × num_cols, column-major),\n2 = Y_batch (M × num_cols, column-major)."
                  }
                },
                {
                  "name": "recordQuantizeQ8_1",
                  "qualified_name": "DmmvDispatch.recordQuantizeQ8_1",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordQuantizeQ8_1( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, ne: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-quantize-q8-1",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-quantize-q8-1",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3299,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3299",
                  "doc": {
                    "summary": "Record a dispatch that quantizes `ne` f32 elements from `a_buf` into Q8_1 blocks (36 bytes each) in `d_buf`.",
                    "description": [
                      "Foundation for mul_mmq — no production callers yet. Requires `ne` to be a multiple of 32. Returns `error.PipelineNotLoaded` when the shader is unavailable, `error.InvalidArgument` when ne is not a multiple of 32."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a dispatch that quantizes `ne` f32 elements from `a_buf` into\nQ8_1 blocks (36 bytes each) in `d_buf`. Foundation for mul_mmq — no\nproduction callers yet. Requires `ne` to be a multiple of 32.\nReturns `error.PipelineNotLoaded` when the shader is unavailable,\n`error.InvalidArgument` when ne is not a multiple of 32."
                  }
                },
                {
                  "name": "recordCountExperts",
                  "qualified_name": "DmmvDispatch.recordCountExperts",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordCountExperts( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, routing_buf: vk.c.VkBuffer, routing_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, n_tokens: u32, n_layers: u32, layer: u32, n_experts_used: u32, n_experts: u32, d_offset_bytes: vk.c.VkDeviceSize, ) !void",
                  "anchor": "dmmv-dispatch-record-count-experts",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-count-experts",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3347,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3347",
                  "doc": {
                    "summary": "Effort 6 Step 3: dispatch the count_experts shader. For one layer, scan a routing buffer that stores per-(token, layer) topk expert IDs and produce a `[n_experts]` u32 count buffer.",
                    "description": [
                      "Layout assumed for `routing_buf`: slot(token, layer) starts at byte offset (token * n_layers + layer) * (2 * n_experts_used) * 4 the first n_experts_used u32s are expert IDs, the next n_experts_used u32s are f32 weights (mirrors router_output_buf packing in forward.zig:5316+).",
                      "`counts_buf` must be sized for at least `n_experts * sizeof(u32)`. Caller is responsible for clearing or overwriting it (the shader writes one element per expert, indexed by gl_WorkGroupID.x).",
                      "Returns `error.PipelineNotLoaded` if the count_experts shader is unavailable, `error.InvalidArgument` for zero token counts."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Effort 6 Step 3: dispatch the count_experts shader. For one layer,\nscan a routing buffer that stores per-(token, layer) topk expert IDs\nand produce a `[n_experts]` u32 count buffer.\n\nLayout assumed for `routing_buf`:\nslot(token, layer) starts at byte offset\n(token * n_layers + layer) * (2 * n_experts_used) * 4\nthe first n_experts_used u32s are expert IDs, the next n_experts_used\nu32s are f32 weights (mirrors router_output_buf packing in\nforward.zig:5316+).\n\n`counts_buf` must be sized for at least `n_experts * sizeof(u32)`.\nCaller is responsible for clearing or overwriting it (the shader\nwrites one element per expert, indexed by gl_WorkGroupID.x).\n\nReturns `error.PipelineNotLoaded` if the count_experts shader is\nunavailable, `error.InvalidArgument` for zero token counts."
                  }
                },
                {
                  "name": "recordMulMmQ4K",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4K",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4K( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-k",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-k",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3411,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3411",
                  "doc": {
                    "summary": "Effort-6 Step 1: dispatch the tiled Q4_K dense GEMM (`mul_mm_q4k.comp`). Computes D[M, N] = A[M, K] (Q4_K) × B[K, N] (f32), where B and D are column-major (B[col][k] = data_b[b_offset + col*stride_b + k], analogously for D).",
                    "description": [
                      "Tile shape: WG = 64 threads producing a 32 × 32 output tile. Dispatch grid: ((M+31)/32) × ((N+31)/32) × 1.",
                      "Constraints: - K must be a multiple of 256 (Q4_K super-block size). - `a_offset` is in BYTES; `b_offset` and `d_offset` are in FLOATS. - Caller is responsible for any preceding clear of D.",
                      "Returns `error.PipelineNotLoaded` if mul_mm_q4k.spv isn't loaded, `error.InvalidArgument` for K-misaligned inputs."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Effort-6 Step 1: dispatch the tiled Q4_K dense GEMM\n(`mul_mm_q4k.comp`). Computes D[M, N] = A[M, K] (Q4_K) × B[K, N] (f32),\nwhere B and D are column-major (B[col][k] = data_b[b_offset +\ncol*stride_b + k], analogously for D).\n\nTile shape: WG = 64 threads producing a 32 × 32 output tile.\nDispatch grid: ((M+31)/32) × ((N+31)/32) × 1.\n\nConstraints:\n- K must be a multiple of 256 (Q4_K super-block size).\n- `a_offset` is in BYTES; `b_offset` and `d_offset` are in FLOATS.\n- Caller is responsible for any preceding clear of D.\n\nReturns `error.PipelineNotLoaded` if mul_mm_q4k.spv isn't loaded,\n`error.InvalidArgument` for K-misaligned inputs."
                  }
                },
                {
                  "name": "recordMulMmIdQ4K",
                  "qualified_name": "DmmvDispatch.recordMulMmIdQ4K",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmIdQ4K( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, ids_buf: vk.c.VkBuffer, ids_size: vk.c.VkDeviceSize, counts_buf: vk.c.VkBuffer, counts_size: vk.c.VkDeviceSize, M: u32, K: u32, stride_b: u32, stride_d: u32, batch_stride_a: u32, batch_stride_d: u32, nei0: u32, nei1: u32, nbi1: u32, a_offset: u32, b_offset: u32, d_offset: u32, ids_offset: u32, n_experts: u32, n_tile_y: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-id-q4-k",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-id-q4-k",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3469,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3469",
                  "doc": {
                    "summary": "Dispatch the routed tiled Q4_K MoE GEMM (`mul_mm_id_q4k.comp`).",
                    "description": [
                      "One dispatch covers all experts: grid.x tiles output rows, grid.y tiles routed token/slot columns per expert, and grid.z is expert id. `counts_buf[e]` must contain the number of token/slot pairs routed to expert `e`; `ids_buf` is the token-major top-k route table scanned by the shader. This path is a validation foundation and is not selected by production prefill yet."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch the routed tiled Q4_K MoE GEMM (`mul_mm_id_q4k.comp`).\nOne dispatch covers all experts: grid.x tiles output rows, grid.y\ntiles routed token/slot columns per expert, and grid.z is expert id.\n`counts_buf[e]` must contain the number of token/slot pairs routed to\nexpert `e`; `ids_buf` is the token-major top-k route table scanned by\nthe shader. This path is a validation foundation and is not selected\nby production prefill yet."
                  }
                },
                {
                  "name": "recordMulMmQ4KDownAcc",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KDownAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KDownAcc( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kdown-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kdown-acc",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3547,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3547",
                  "doc": {
                    "summary": "Tiled Q4_K dense GEMM with fused-residual accumulate: identical to recordMulMmQ4K but the output ACCUMULATES into D (d[idx] += result) instead of overwriting.",
                    "description": [
                      "Eliminates the standalone barrier + scale_accumulate dispatch for the dense-FFN residual add. Ragged shapes (M or N not multiples of 32) are handled by boundary checks in the shader."
                    ],
                    "params": [
                      {
                        "name": "M",
                        "description": "Output rows (weight rows, i.e. hidden_dim for down projection)."
                      },
                      {
                        "name": "N",
                        "description": "Token batch size (number of columns)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width; must be a multiple of 256."
                      }
                    ],
                    "returns": "`error.PipelineNotLoaded` if the acc pipeline is absent, or `error.InvalidArgument` for zero/misaligned K or zero M/N.",
                    "notes": [],
                    "raw": "Tiled Q4_K dense GEMM with fused-residual accumulate: identical to\nrecordMulMmQ4K but the output ACCUMULATES into D (d[idx] += result)\ninstead of overwriting. Eliminates the standalone barrier +\nscale_accumulate dispatch for the dense-FFN residual add. Ragged\nshapes (M or N not multiples of 32) are handled by boundary checks\nin the shader."
                  }
                },
                {
                  "name": "recordMulMmQ4KDownAccWide",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KDownAccWide",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KDownAccWide( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kdown-acc-wide",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kdown-acc-wide",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3601,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3601",
                  "doc": {
                    "summary": "Wide-tile (BN=64) variant of recordMulMmQ4KDownAcc.",
                    "description": [
                      "Each WG produces a 32×64 output tile. Caller must ensure N is a multiple of 64 for full efficiency (the shader handles ragged N via bounds checks)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Wide-tile (BN=64) variant of recordMulMmQ4KDownAcc. Each WG produces a\n32×64 output tile. Caller must ensure N is a multiple of 64 for full\nefficiency (the shader handles ragged N via bounds checks)."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwiglu",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwiglu",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwiglu( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3658,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3658",
                  "doc": {
                    "summary": "Tiled Q4_K batched dense FFN front-end: computes silu(gate_weight * B) * (up_weight * B) directly into D.",
                    "description": [
                      "Ragged (M or N not multiples of 32) shapes are handled by boundary checks in the shader."
                    ],
                    "params": [
                      {
                        "name": "M",
                        "description": "Output rows (gate/up weight rows, i.e. inter_dim)."
                      },
                      {
                        "name": "N",
                        "description": "Token batch size (number of columns)."
                      },
                      {
                        "name": "K",
                        "description": "Contraction width; must be a multiple of 256."
                      }
                    ],
                    "returns": "`error.PipelineNotLoaded` if the gate+up+SwiGLU pipeline is absent, or `error.InvalidArgument` for zero/misaligned K or zero M/N.",
                    "notes": [],
                    "raw": "Tiled Q4_K batched dense FFN front-end: computes silu(gate_weight * B) * (up_weight * B) directly into D.\nRagged (M or N not multiples of 32) shapes are handled by boundary checks in the shader."
                  }
                },
                {
                  "name": "recordMulMmQ4KTail8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KTail8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KTail8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-ktail8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-ktail8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3713,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3713",
                  "doc": {
                    "summary": "BN=8 Q4_K GEMM for narrow token tails after the generic 32-column path.",
                    "description": [
                      "Requires row-aligned M; N may be 1..8 and is bounds-checked in-shader."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "BN=8 Q4_K GEMM for narrow token tails after the generic 32-column path.\nRequires row-aligned M; N may be 1..8 and is bounds-checked in-shader."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGeglu",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGeglu",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGeglu( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3763,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3763",
                  "doc": {
                    "summary": "Tiled Q4_K batched Gemma dense FFN front-end: computes gelu(gate_weight * B) * (up_weight * B) directly into D.",
                    "description": [
                      "Same binding and push layout as recordMulMmQ4KGateUpSwiglu."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Tiled Q4_K batched Gemma dense FFN front-end: computes gelu(gate_weight * B) * (up_weight * B) directly into D.\nSame binding and push layout as recordMulMmQ4KGateUpSwiglu."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluFull",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluFull",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluFull( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3819,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3819",
                  "doc": {
                    "summary": "Branchless full-tile Q4_K gate/up/GEGLU GEMM for Gemma dense prefill.",
                    "description": [
                      "Requires M and N to be multiples of 32; ragged token tails use the checked recordMulMmQ4KGateUpGeglu path."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Branchless full-tile Q4_K gate/up/GEGLU GEMM for Gemma dense prefill.\nRequires M and N to be multiples of 32; ragged token tails use the\nchecked recordMulMmQ4KGateUpGeglu path."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluTail8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluTail8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluTail8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-tail8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-tail8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3872,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3872",
                  "doc": {
                    "summary": "BN=8 Q4_K gate/up/GEGLU GEMM for narrow token tails after the 32-column full-tile path.",
                    "description": [
                      "Requires row-aligned M; N may be 1..8."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "BN=8 Q4_K gate/up/GEGLU GEMM for narrow token tails after the\n32-column full-tile path. Requires row-aligned M; N may be 1..8."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFull",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFull",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFull( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3926,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3926",
                  "doc": {
                    "summary": "Branchless full-tile Q4_K gate/up/SwiGLU GEMM.",
                    "description": [
                      "Requires M and N to be multiples of 32; ragged token tails use the checked recordMulMmQ4KGateUpSwiglu path."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Branchless full-tile Q4_K gate/up/SwiGLU GEMM.\nRequires M and N to be multiples of 32; ragged token tails use the\nchecked recordMulMmQ4KGateUpSwiglu path."
                  }
                },
                {
                  "name": "recordMulMmQ6K",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6K",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6K( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-k",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-k",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 3979,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L3979",
                  "doc": {
                    "summary": "Tiled Q6_K dense GEMM.",
                    "description": [
                      "Same push/layout as recordMulMmQ4K. Used by Qwen3.6-27B layer-major prefill for dense-down and SSM wqkv."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Tiled Q6_K dense GEMM. Same push/layout as recordMulMmQ4K.\nUsed by Qwen3.6-27B layer-major prefill for dense-down and SSM wqkv."
                  }
                },
                {
                  "name": "recordMulMmQ6KTail8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KTail8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KTail8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-ktail8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-ktail8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4031,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4031",
                  "doc": {
                    "summary": "BN=8 Q6_K GEMM for narrow token tails after the 32-column full-tile path.",
                    "description": [
                      "Requires row-aligned M; N may be 1..8 and is bounds-checked in-shader."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "BN=8 Q6_K GEMM for narrow token tails after the 32-column full-tile path.\nRequires row-aligned M; N may be 1..8 and is bounds-checked in-shader."
                  }
                },
                {
                  "name": "recordMulMmQ5K",
                  "qualified_name": "DmmvDispatch.recordMulMmQ5K",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ5K( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q5-k",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q5-k",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4082,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4082",
                  "doc": {
                    "summary": "Tiled Q5_K dense GEMM.",
                    "description": [
                      "Same push/layout as recordMulMmQ4K/recordMulMmQ6K. Used by Qwen3.6-27B layer-major prefill for the SSM out projection, which otherwise falls through to the dmmv_q5k one-WG-per-row batched path."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Tiled Q5_K dense GEMM. Same push/layout as recordMulMmQ4K/recordMulMmQ6K.\nUsed by Qwen3.6-27B layer-major prefill for the SSM out projection, which\notherwise falls through to the dmmv_q5k one-WG-per-row batched path."
                  }
                },
                {
                  "name": "recordMulMmQ5KWide",
                  "qualified_name": "DmmvDispatch.recordMulMmQ5KWide",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ5KWide( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q5-kwide",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q5-kwide",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4134,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4134",
                  "doc": {
                    "summary": "Wide-tile (BN=64) variant of recordMulMmQ5K.",
                    "description": [
                      "Each WG produces a 32×64 output tile. Halves weight VRAM traffic for N=64 prefill."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Wide-tile (BN=64) variant of recordMulMmQ5K. Each WG produces a 32×64\noutput tile. Halves weight VRAM traffic for N=64 prefill."
                  }
                },
                {
                  "name": "recordMulMmQ8_0",
                  "qualified_name": "DmmvDispatch.recordMulMmQ8_0",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ8_0( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q8-0",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q8-0",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4188,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4188",
                  "doc": {
                    "summary": "Tiled Q8_0 dense GEMM for Qwen3.6 A3B layer-major prefill (SSM out projection).",
                    "description": [
                      "Uses the same `MulMmQ4KPush` layout as `recordMulMmQ4K`, but K must be a multiple of 32 (not 256)."
                    ],
                    "params": [],
                    "returns": "`error.PipelineNotLoaded` if the Q8_0 GEMM pipeline is absent, or `error.InvalidArgument` for K not a multiple of 32 or zero M/N.",
                    "notes": [],
                    "raw": "Tiled Q8_0 dense GEMM for Qwen3.6 A3B layer-major prefill (SSM out projection).\nUses the same `MulMmQ4KPush` layout as `recordMulMmQ4K`, but K must be a multiple of 32 (not 256)."
                  }
                },
                {
                  "name": "recordMulMmQ8_0FullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ8_0FullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ8_0FullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_buf: vk.c.VkBuffer, b_scale_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q8-0-full-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q8-0-full-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4239,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4239",
                  "doc": {
                    "summary": "Record an int8 DP4a full-tile Q8_0 GEMM.",
                    "description": [
                      "The activation must already be quantized with recordQuantizeActQ8. Ragged token tails stay on the f32 recordMulMmQ8_0 path at the call site."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record an int8 DP4a full-tile Q8_0 GEMM. The activation must already\nbe quantized with recordQuantizeActQ8. Ragged token tails stay on the\nf32 recordMulMmQ8_0 path at the call site."
                  }
                },
                {
                  "name": "recordMulMmQ6KFull",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KFull",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KFull( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kfull",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kfull",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4290,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4290",
                  "doc": {
                    "summary": "Branchless full-tile Q6_K GEMM for 32-aligned token counts; the host routes only 32-aligned M/N tiles here.",
                    "description": [],
                    "params": [],
                    "returns": "`error.PipelineNotLoaded` if the full-tile pipeline is absent, or `error.InvalidArgument` for misaligned or zero dimensions.",
                    "notes": [
                      "M and N must both be multiples of 32; ragged tails must use `recordMulMmQ6K` instead."
                    ],
                    "raw": "Branchless full-tile Q6_K GEMM for 32-aligned token counts; the host routes only 32-aligned M/N tiles here."
                  }
                },
                {
                  "name": "recordMulMmQ6KFullDownAcc",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KFullDownAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KFullDownAcc( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_buf: vk.c.VkBuffer, b_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, stride_b: u32, stride_d: u32, a_offset: u32, b_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kfull-down-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kfull-down-acc",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4342,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4342",
                  "doc": {
                    "summary": "Fused-residual variant of `recordMulMmQ6KFull`: the output ACCUMULATES into d_data (d[idx] += result) instead of overwriting.",
                    "description": [
                      "This eliminates the standalone barrier + scale_accumulate dispatch that adds the dense-FFN residual. Same shape constraints as `recordMulMmQ6KFull`."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Fused-residual variant of `recordMulMmQ6KFull`: the output ACCUMULATES\ninto d_data (d[idx] += result) instead of overwriting. This eliminates\nthe standalone barrier + scale_accumulate dispatch that adds the\ndense-FFN residual. Same shape constraints as `recordMulMmQ6KFull`."
                  }
                },
                {
                  "name": "recordQuantizeActQ8",
                  "qualified_name": "DmmvDispatch.recordQuantizeActQ8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordQuantizeActQ8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, src_buf: vk.c.VkBuffer, src_size: vk.c.VkDeviceSize, dst_packed_buf: vk.c.VkBuffer, dst_packed_size: vk.c.VkDeviceSize, dst_scale_buf: vk.c.VkBuffer, dst_scale_size: vk.c.VkDeviceSize, n_tokens: u32, K: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-quantize-act-q8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-quantize-act-q8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4395,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4395",
                  "doc": {
                    "summary": "Quantize an f32 activation matrix to packed int8 + per-32-block scales (one shot, no per-tile redundancy) for the int8 DP4a dense-down GEMM.",
                    "description": [],
                    "params": [
                      {
                        "name": "src_buf",
                        "description": "token-major f32 activation [n_tokens][K]."
                      },
                      {
                        "name": "dst_packed_buf",
                        "description": "token-major packed int8 [n_tokens][K/4] (4 lanes/uint)."
                      },
                      {
                        "name": "dst_scale_buf",
                        "description": "token-major f32 scale [n_tokens][K/32]."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Quantize an f32 activation matrix to packed int8 + per-32-block scales\n(one shot, no per-tile redundancy) for the int8 DP4a dense-down GEMM."
                  }
                },
                {
                  "name": "recordMulMmQ6KFullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KFullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KFullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_buf: vk.c.VkBuffer, b_scale_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, accumulate: bool, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kfull-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kfull-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4437,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4437",
                  "doc": {
                    "summary": "Record the int8 DP4a full-tile Q6_K dense-down GEMM.",
                    "description": [
                      "Weights are Q6_K; the activation arrives pre-quantized (packed int8 + per-32-block f32 scale) from recordQuantizeActQ8. Output is token-major f32 [N][M]."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record the int8 DP4a full-tile Q6_K dense-down GEMM. Weights are Q6_K;\nthe activation arrives pre-quantized (packed int8 + per-32-block f32 scale)\nfrom recordQuantizeActQ8. Output is token-major f32 [N][M]."
                  }
                },
                {
                  "name": "recordMulMmQ6KFullDp4aN64InterleavedAcc",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KFullDp4aN64InterleavedAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KFullDp4aN64InterleavedAcc( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_buf: vk.c.VkBuffer, b_scale_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kfull-dp4a-n64-interleaved-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kfull-dp4a-n64-interleaved-acc",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4573,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4573",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordMulMmQ6KRagged72Dp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KRagged72Dp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KRagged72Dp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_buf: vk.c.VkBuffer, b_scale_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kragged72-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kragged72-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4623,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4623",
                  "doc": {
                    "summary": "Guarded BN=72 int8 DP4a Q6_K dense-down GEMM for Gemma 4 31B's 65-72 token public prompt shape.",
                    "description": [
                      "This covers the 64-column body and <=8-column ragged tail in one pass over the K=21504 down weights."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Guarded BN=72 int8 DP4a Q6_K dense-down GEMM for Gemma 4 31B's\n65-72 token public prompt shape. This covers the 64-column body and\n<=8-column ragged tail in one pass over the K=21504 down weights."
                  }
                },
                {
                  "name": "recordMulMmQ6KTail8Dp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KTail8Dp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KTail8Dp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_buf: vk.c.VkBuffer, b_scale_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, b_packed_offset: u32, b_scale_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-ktail8-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-ktail8-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4676,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4676",
                  "doc": {
                    "summary": "BN=8 int8 DP4a Q6_K dense-down tail for Gemma 4 31B short prompts.",
                    "description": [
                      "The packed/scaled activation descriptors are offset to the first tail token, while the output uses d_offset so the token-major destination layout remains contiguous with the full 64-token prefix."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "BN=8 int8 DP4a Q6_K dense-down tail for Gemma 4 31B short prompts.\nThe packed/scaled activation descriptors are offset to the first tail\ntoken, while the output uses d_offset so the token-major destination\nlayout remains contiguous with the full 64-token prefix."
                  }
                },
                {
                  "name": "recordMulMmQ6KFullDp4aQ8_1",
                  "qualified_name": "DmmvDispatch.recordMulMmQ6KFullDp4aQ8_1",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ6KFullDp4aQ8_1( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q6-kfull-dp4a-q8-1",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q6-kfull-dp4a-q8-1",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4742,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4742",
                  "doc": {
                    "summary": "Q8_1-input variant: same Q6_K DP4a GEMM but the activation scale buffer is `vec2 b_scale_dsum[]` per 32-block (Q4_K-style layout).",
                    "description": [
                      "The shader reads `.x` only — `.y` (dsum) is unused since Q6_K weights have no per-block bias term. Used by the Qwen3.6-27B SSM wqkv projection so it can share a single Q8_1 quantize of scratch_norm with the Q4_K z projection. Push constant stride_b_scale = K/32 (number of vec2 entries per token), same numeric value as the Q8_0 variant since the indexing is in typed-element units."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Q8_1-input variant: same Q6_K DP4a GEMM but the activation scale\nbuffer is `vec2 b_scale_dsum[]` per 32-block (Q4_K-style layout). The\nshader reads `.x` only — `.y` (dsum) is unused since Q6_K weights have\nno per-block bias term. Used by the Qwen3.6-27B SSM wqkv projection so\nit can share a single Q8_1 quantize of scratch_norm with the Q4_K z\nprojection. Push constant stride_b_scale = K/32 (number of vec2 entries\nper token), same numeric value as the Q8_0 variant since the indexing\nis in typed-element units."
                  }
                },
                {
                  "name": "recordQuantizeActQ8_1",
                  "qualified_name": "DmmvDispatch.recordQuantizeActQ8_1",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordQuantizeActQ8_1( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, src_buf: vk.c.VkBuffer, src_size: vk.c.VkDeviceSize, dst_packed_buf: vk.c.VkBuffer, dst_packed_size: vk.c.VkDeviceSize, dst_scale_dsum_buf: vk.c.VkBuffer, dst_scale_dsum_size: vk.c.VkDeviceSize, n_tokens: u32, K: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-quantize-act-q8-1",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-quantize-act-q8-1",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4818,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4818",
                  "doc": {
                    "summary": "Q8_1-style activation quantize: packed int8 + per-32-block (scale, dsum) for the DP4a Q4_K gate+up GEMM bias-correction term.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Q8_1-style activation quantize: packed int8 + per-32-block (scale, dsum)\nfor the DP4a Q4_K gate+up GEMM bias-correction term."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4861,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4861",
                  "doc": {
                    "summary": "int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM for Qwen3.6-27B dense FFN prefill.",
                    "description": [
                      "Activations arrive pre-quantized from recordQuantizeActQ8_1 (packed int8 + per-32-block (scale, dsum)). Output is silu(gate)*up, token-major f32 [N][M]."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM for Qwen3.6-27B dense FFN\nprefill. Activations arrive pre-quantized from recordQuantizeActQ8_1\n(packed int8 + per-32-block (scale, dsum)). Output is silu(gate)*up,\ntoken-major f32 [N][M]."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluFullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluFullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluFullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4916,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4916",
                  "doc": {
                    "summary": "int8 DP4a full-tile Q4_K gate+up+GEGLU GEMM for Gemma dense FFN prefill.",
                    "description": [
                      "Activations arrive pre-quantized from recordQuantizeActQ8_1 (packed int8 + per-32-block (scale, dsum)). Output is gelu(gate)*up, token-major f32 [N][M]."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "int8 DP4a full-tile Q4_K gate+up+GEGLU GEMM for Gemma dense FFN\nprefill. Activations arrive pre-quantized from recordQuantizeActQ8_1\n(packed int8 + per-32-block (scale, dsum)). Output is gelu(gate)*up,\ntoken-major f32 [N][M]."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFullDp4aQ8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFullDp4aQ8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFullDp4aQ8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_buf: vk.c.VkBuffer, d_scale_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_packed_offset: u32, d_scale_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 4973,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L4973",
                  "doc": {
                    "summary": "int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM that emits Q8_0-style packed activation directly.",
                    "description": [
                      "Output layout matches quantize_act_q8.comp (per-token packed int8 + per-32-block scale), so the downstream dense-down DP4a kernel can consume it directly without the standalone quantize_act_q8 dispatch + barrier. The f32 SwiGLU intermediate is never written to global memory."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "int8 DP4a full-tile Q4_K gate+up+SwiGLU GEMM that emits Q8_0-style\npacked activation directly. Output layout matches quantize_act_q8.comp\n(per-token packed int8 + per-32-block scale), so the downstream\ndense-down DP4a kernel can consume it directly without the standalone\nquantize_act_q8 dispatch + barrier. The f32 SwiGLU intermediate is\nnever written to global memory."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFullDp4aQ8N64Interleaved",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFullDp4aQ8N64Interleaved",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFullDp4aQ8N64Interleaved( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_buf: vk.c.VkBuffer, d_scale_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_packed_offset: u32, d_scale_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-n64-interleaved",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-n64-interleaved",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5080,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5080",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluFullDp4aQ8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluFullDp4aQ8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluFullDp4aQ8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_buf: vk.c.VkBuffer, d_scale_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, b_packed_offset: u32, b_scale_offset: u32, d_packed_offset: u32, d_scale_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a-q8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a-q8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5140,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5140",
                  "doc": {
                    "summary": "Gemma GEGLU variant of recordMulMmQ4KGateUpSwigluFullDp4aQ8.",
                    "description": [
                      "Emits Q8_0-style packed GEGLU activation for Q6_K dense-down DP4a."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Gemma GEGLU variant of recordMulMmQ4KGateUpSwigluFullDp4aQ8. Emits\nQ8_0-style packed GEGLU activation for Q6_K dense-down DP4a."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluN1Dp4aQ8",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluN1Dp4aQ8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluN1Dp4aQ8( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_buf: vk.c.VkBuffer, d_scale_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, b_packed_offset: u32, b_scale_offset: u32, d_packed_offset: u32, d_scale_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-n1-dp4a-q8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-n1-dp4a-q8",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5228,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5228",
                  "doc": {
                    "summary": "Single-token Gemma GEGLU producer for Q6_K-down decode.",
                    "description": [
                      "Same bindings and push layout as recordMulMmQ4KGateUpGegluFullDp4aQ8, but fixed to one token so all lanes do useful work instead of guarding seven BN=8 columns."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Single-token Gemma GEGLU producer for Q6_K-down decode. Same bindings\nand push layout as recordMulMmQ4KGateUpGegluFullDp4aQ8, but fixed to\none token so all lanes do useful work instead of guarding seven BN=8\ncolumns."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFullDp4aQ8_1",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFullDp4aQ8_1",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFullDp4aQ8_1( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_dsum_buf: vk.c.VkBuffer, d_scale_dsum_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_packed_offset: u32, d_scale_dsum_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-1",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-1",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5298,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5298",
                  "doc": {
                    "summary": "Q4_K-down sibling of recordMulMmQ4KGateUpSwigluFullDp4aQ8.",
                    "description": [
                      "Same fused gate+up+SwiGLU DP4a GEMM, but emits Q8_1-style activation (packed int8 + per-32-block (scale, dsum) vec2) so the downstream mul_mm_q4k_full_dp4a (Q4_K-down) consumer can skip the standalone quantize_act_q8_1 dispatch + barrier. dsum = scale * sum(int8_lanes) is computed inside the kernel via subgroupClusteredAdd cluster_size=TPR_M=8, so there's no LDS round-trip beyond the GEMM's existing barriers. Caller is responsible for sizing d_scale_dsum_buf as 2x the Q8_0 scale buffer (per-block vec2 instead of per-block float)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Q4_K-down sibling of recordMulMmQ4KGateUpSwigluFullDp4aQ8. Same fused\ngate+up+SwiGLU DP4a GEMM, but emits Q8_1-style activation (packed int8\n+ per-32-block (scale, dsum) vec2) so the downstream mul_mm_q4k_full_dp4a\n(Q4_K-down) consumer can skip the standalone quantize_act_q8_1 dispatch\n+ barrier. dsum = scale * sum(int8_lanes) is computed inside the kernel\nvia subgroupClusteredAdd cluster_size=TPR_M=8, so there's no LDS\nround-trip beyond the GEMM's existing barriers. Caller is responsible\nfor sizing d_scale_dsum_buf as 2x the Q8_0 scale buffer (per-block\nvec2 instead of per-block float)."
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpSwigluFullDp4aQ8_1N64Interleaved",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpSwigluFullDp4aQ8_1N64Interleaved",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpSwigluFullDp4aQ8_1N64Interleaved( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_dsum_buf: vk.c.VkBuffer, d_scale_dsum_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_packed_offset: u32, d_scale_dsum_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-1-n64-interleaved",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-swiglu-full-dp4a-q8-1-n64-interleaved",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5405,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5405",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordMulMmQ4KGateUpGegluFullDp4aQ8_1",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KGateUpGegluFullDp4aQ8_1",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KGateUpGegluFullDp4aQ8_1( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, gate_buf: vk.c.VkBuffer, gate_size: vk.c.VkDeviceSize, up_buf: vk.c.VkBuffer, up_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_packed_buf: vk.c.VkBuffer, d_packed_size: vk.c.VkDeviceSize, d_scale_dsum_buf: vk.c.VkBuffer, d_scale_dsum_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, b_packed_offset: u32, b_scale_offset: u32, d_packed_offset: u32, d_scale_dsum_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a-q8-1",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kgate-up-geglu-full-dp4a-q8-1",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5465,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5465",
                  "doc": {
                    "summary": "Gemma GEGLU variant of recordMulMmQ4KGateUpSwigluFullDp4aQ8_1.",
                    "description": [
                      "Emits Q8_1-style packed GEGLU activation for Q4_K dense-down DP4a."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Gemma GEGLU variant of recordMulMmQ4KGateUpSwigluFullDp4aQ8_1. Emits\nQ8_1-style packed GEGLU activation for Q4_K dense-down DP4a."
                  }
                },
                {
                  "name": "recordMulMmQ5KFullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ5KFullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ5KFullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q5-kfull-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q5-kfull-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5555,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5555",
                  "doc": {
                    "summary": "int8 DP4a full-tile single Q5_K GEMM (no fused activation).",
                    "description": [
                      "Used by the Qwen3.6-27B SSM out prefill projection (M=hidden_dim, K=d_inner). Activations arrive pre-quantized (packed int8 + per-32-block (scale, dsum)) from recordQuantizeActQ8_1. Output is token-major f32 [N][M]. Same push/binding shape as recordMulMmQ4KFullDp4a — the only difference is the 5-bit weight unpack inside the kernel."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "int8 DP4a full-tile single Q5_K GEMM (no fused activation). Used by the\nQwen3.6-27B SSM out prefill projection (M=hidden_dim, K=d_inner).\nActivations arrive pre-quantized (packed int8 + per-32-block (scale,\ndsum)) from recordQuantizeActQ8_1. Output is token-major f32 [N][M].\nSame push/binding shape as recordMulMmQ4KFullDp4a — the only difference\nis the 5-bit weight unpack inside the kernel."
                  }
                },
                {
                  "name": "recordMulMmQ4KFullDp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KFullDp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KFullDp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, accumulate: bool, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kfull-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kfull-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5624,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5624",
                  "doc": {
                    "summary": "int8 DP4a full-tile single Q4_K GEMM (no fused activation).",
                    "description": [
                      "Used by the Qwen3.6-27B SSM z prefill projection. Activations arrive pre-quantized (packed int8 + per-32-block (scale, dsum)) from recordQuantizeActQ8_1. Output is token-major f32 [N][M]."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "int8 DP4a full-tile single Q4_K GEMM (no fused activation). Used by the\nQwen3.6-27B SSM z prefill projection. Activations arrive pre-quantized\n(packed int8 + per-32-block (scale, dsum)) from recordQuantizeActQ8_1.\nOutput is token-major f32 [N][M]."
                  }
                },
                {
                  "name": "recordMulMmQ4KFullDp4aN64InterleavedAcc",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KFullDp4aN64InterleavedAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KFullDp4aN64InterleavedAcc( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-kfull-dp4a-n64-interleaved-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-kfull-dp4a-n64-interleaved-acc",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5773,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5773",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "recordMulMmQ4KTail8Dp4a",
                  "qualified_name": "DmmvDispatch.recordMulMmQ4KTail8Dp4a",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMulMmQ4KTail8Dp4a( self: *const DmmvDispatch, cmd: *CommandBuffer, push_desc_fn: ?PushDescriptorFn, a_buf: vk.c.VkBuffer, a_size: vk.c.VkDeviceSize, b_packed_buf: vk.c.VkBuffer, b_packed_size: vk.c.VkDeviceSize, b_scale_dsum_buf: vk.c.VkBuffer, b_scale_dsum_size: vk.c.VkDeviceSize, d_buf: vk.c.VkBuffer, d_size: vk.c.VkDeviceSize, M: u32, N: u32, K: u32, a_offset: u32, b_packed_offset: u32, b_scale_dsum_offset: u32, d_offset: u32, ) !void",
                  "anchor": "dmmv-dispatch-record-mul-mm-q4-ktail8-dp4a",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-record-mul-mm-q4-ktail8-dp4a",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5823,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5823",
                  "doc": {
                    "summary": "BN=8 int8 DP4a Q4_K dense-down tail for Gemma 4 31B short prompts.",
                    "description": [
                      "Descriptor offsets select the tail token slice of the pre-quantized Q8_1 activation buffers; d_offset keeps the f32 output token-major."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "BN=8 int8 DP4a Q4_K dense-down tail for Gemma 4 31B short prompts.\nDescriptor offsets select the tail token slice of the pre-quantized\nQ8_1 activation buffers; d_offset keeps the f32 output token-major."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "DmmvDispatch.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *DmmvDispatch) void",
                  "anchor": "dmmv-dispatch-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/dmmv/#dmmv-dispatch-deinit",
                  "source_path": "src/compute/dmmv.zig",
                  "source_line": 5889,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/dmmv.zig#L5889",
                  "doc": {
                    "summary": "Destroy the loaded pipelines and descriptor pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the loaded pipelines and descriptor pool."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "elementwise",
          "title": "Elementwise",
          "section": "Shader Dispatch",
          "summary": "Wrap the fused element-wise shader family used by the decode loop.",
          "overview": [
            "This helper loads the RMS norm, SwiGLU, and RoPE pipelines and records the push constants needed for their dispatches."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/",
          "source_path": "src/compute/elementwise.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L17",
          "counts": {
            "code_lines": 996,
            "exports": 35,
            "methods": 24,
            "symbols": 59
          },
          "symbols": [
            {
              "name": "RmsNormPush",
              "qualified_name": "RmsNormPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RmsNormPush = extern struct",
              "anchor": "rms-norm-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rms-norm-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 17,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L17",
              "doc": {
                "summary": "Push constants for RMS norm shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for RMS norm shader."
              },
              "members": []
            },
            {
              "name": "SwigluPush",
              "qualified_name": "SwigluPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SwigluPush = extern struct",
              "anchor": "swiglu-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#swiglu-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 23,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L23",
              "doc": {
                "summary": "Push constants for SwiGLU shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for SwiGLU shader."
              },
              "members": []
            },
            {
              "name": "DeinterleavePush",
              "qualified_name": "DeinterleavePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DeinterleavePush = extern struct",
              "anchor": "deinterleave-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#deinterleave-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 33,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L33",
              "doc": {
                "summary": "Push constants for deinterleave shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for deinterleave shader."
              },
              "members": []
            },
            {
              "name": "SigmoidMulPush",
              "qualified_name": "SigmoidMulPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SigmoidMulPush = extern struct",
              "anchor": "sigmoid-mul-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#sigmoid-mul-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 39,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L39",
              "doc": {
                "summary": "Push constants for sigmoid multiply shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for sigmoid multiply shader."
              },
              "members": []
            },
            {
              "name": "ScaleAccPush",
              "qualified_name": "ScaleAccPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ScaleAccPush = extern struct",
              "anchor": "scale-acc-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#scale-acc-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 44,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L44",
              "doc": {
                "summary": "Push constants for scale-accumulate shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for scale-accumulate shader."
              },
              "members": []
            },
            {
              "name": "BiasAddPush",
              "qualified_name": "BiasAddPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const BiasAddPush = extern struct",
              "anchor": "bias-add-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#bias-add-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L50",
              "doc": {
                "summary": "Push constants for bias add shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for bias add shader."
              },
              "members": []
            },
            {
              "name": "RopePush",
              "qualified_name": "RopePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RopePush = extern struct",
              "anchor": "rope-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rope-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 56,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L56",
              "doc": {
                "summary": "Push constants for RoPE shader (with partial rotation / IMRoPE support).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for RoPE shader (with partial rotation / IMRoPE support)."
              },
              "members": []
            },
            {
              "name": "RopeBatchedPush",
              "qualified_name": "RopeBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RopeBatchedPush = extern struct",
              "anchor": "rope-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rope-batched-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 67,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L67",
              "doc": {
                "summary": "Push constants for rope_batched (multi-token prefill variant).",
                "description": [
                  "Layout mirrors src/shaders/rope_batched.comp."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for rope_batched (multi-token prefill variant).\nLayout mirrors src/shaders/rope_batched.comp."
              },
              "members": []
            },
            {
              "name": "SsmConv1dPush",
              "qualified_name": "SsmConv1dPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SsmConv1dPush = extern struct",
              "anchor": "ssm-conv1d-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#ssm-conv1d-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 77,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L77",
              "doc": {
                "summary": "Push constants for SSM conv1d + SiLU shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for SSM conv1d + SiLU shader."
              },
              "members": []
            },
            {
              "name": "SsmConv1dBatchedPush",
              "qualified_name": "SsmConv1dBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SsmConv1dBatchedPush = extern struct",
              "anchor": "ssm-conv1d-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#ssm-conv1d-batched-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 87,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L87",
              "doc": {
                "summary": "Push constants for the batched SSM conv1d shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the batched SSM conv1d shader."
              },
              "members": []
            },
            {
              "name": "F32DualBatchPush",
              "qualified_name": "F32DualBatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const F32DualBatchPush = extern struct",
              "anchor": "f32-dual-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#f32-dual-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 96,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L96",
              "doc": {
                "summary": "Push constants for batched f32 dual DMMV (SSM alpha/beta).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for batched f32 dual DMMV (SSM alpha/beta)."
              },
              "members": []
            },
            {
              "name": "SsmDeltaNetPush",
              "qualified_name": "SsmDeltaNetPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SsmDeltaNetPush = extern struct",
              "anchor": "ssm-delta-net-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#ssm-delta-net-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 104,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L104",
              "doc": {
                "summary": "Push constants for SSM delta-net state update shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for SSM delta-net state update shader."
              },
              "members": []
            },
            {
              "name": "SsmQkNormPush",
              "qualified_name": "SsmQkNormPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SsmQkNormPush = extern struct",
              "anchor": "ssm-qk-norm-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#ssm-qk-norm-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 126,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L126",
              "doc": {
                "summary": "Push constants for the SSM Q/K RMS-norm shader.",
                "description": [
                  "Drives the per-group normalization applied to query and key projections inside Mamba/SSM blocks."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the SSM Q/K RMS-norm shader. Drives the per-group\nnormalization applied to query and key projections inside Mamba/SSM blocks."
              },
              "members": []
            },
            {
              "name": "SsmGatedNormPush",
              "qualified_name": "SsmGatedNormPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SsmGatedNormPush = extern struct",
              "anchor": "ssm-gated-norm-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#ssm-gated-norm-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 133,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L133",
              "doc": {
                "summary": "Push constants for SSM gated norm shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for SSM gated norm shader."
              },
              "members": []
            },
            {
              "name": "SoftmaxTopkPush",
              "qualified_name": "SoftmaxTopkPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SoftmaxTopkPush = extern struct",
              "anchor": "softmax-topk-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#softmax-topk-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 143,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L143",
              "doc": {
                "summary": "Push constants for softmax + top-k MoE router shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for softmax + top-k MoE router shader."
              },
              "members": []
            },
            {
              "name": "RouterF32BatchPush",
              "qualified_name": "RouterF32BatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RouterF32BatchPush = extern struct",
              "anchor": "router-f32-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#router-f32-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 152,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L152",
              "doc": {
                "summary": "Push constants for token-batched f32 router matvec.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for token-batched f32 router matvec."
              },
              "members": []
            },
            {
              "name": "RmsNormScaleDmmvF32BatchPush",
              "qualified_name": "RmsNormScaleDmmvF32BatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RmsNormScaleDmmvF32BatchPush = extern struct",
              "anchor": "rms-norm-scale-dmmv-f32-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rms-norm-scale-dmmv-f32-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 161,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L161",
              "doc": {
                "summary": "Push constants for token-batched Gemma router RMS norm + scale + f32 DMMV.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for token-batched Gemma router RMS norm + scale + f32 DMMV."
              },
              "members": []
            },
            {
              "name": "SoftmaxTopkBatchPush",
              "qualified_name": "SoftmaxTopkBatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SoftmaxTopkBatchPush = extern struct",
              "anchor": "softmax-topk-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#softmax-topk-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 169,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L169",
              "doc": {
                "summary": "Push constants for token-batched MoE top-k.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for token-batched MoE top-k."
              },
              "members": []
            },
            {
              "name": "MoeWeightedAccPush",
              "qualified_name": "MoeWeightedAccPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeWeightedAccPush = extern struct",
              "anchor": "moe-weighted-acc-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#moe-weighted-acc-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 181,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L181",
              "doc": {
                "summary": "Push constants for batched MoE weighted accumulate shader.",
                "description": [
                  "Sums all expert outputs at once: a[i] = sum_j(weight_j * b[j*src_stride+i])."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for batched MoE weighted accumulate shader.\nSums all expert outputs at once: a[i] = sum_j(weight_j * b[j*src_stride+i])."
              },
              "members": []
            },
            {
              "name": "MoeWeightedAccBatchPush",
              "qualified_name": "MoeWeightedAccBatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeWeightedAccBatchPush = extern struct",
              "anchor": "moe-weighted-acc-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#moe-weighted-acc-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 190,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L190",
              "doc": {
                "summary": "Push constants for the **batched** MoE weighted-accumulate shader.",
                "description": [
                  "Sums each token's `n_used` selected-expert outputs across a token batch in one dispatch: `a[t,i] = sum_j(weight_{t,j} * b[...])`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the **batched** MoE weighted-accumulate shader.\nSums each token's `n_used` selected-expert outputs across a token batch in one\ndispatch: `a[t,i] = sum_j(weight_{t,j} * b[...])`."
              },
              "members": []
            },
            {
              "name": "MoeWeightedAccScaledBatchPush",
              "qualified_name": "MoeWeightedAccScaledBatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MoeWeightedAccScaledBatchPush = extern struct",
              "anchor": "moe-weighted-acc-scaled-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#moe-weighted-acc-scaled-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 202,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L202",
              "doc": {
                "summary": "Push constants for the Gemma batched MoE weighted-accumulate shader.",
                "description": [
                  "Same route-major contract as `MoeWeightedAccBatchPush`, with an extra per-expert scale offset for model-specific down-projection scales."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the Gemma batched MoE weighted-accumulate shader.\nSame route-major contract as `MoeWeightedAccBatchPush`, with an extra\nper-expert scale offset for model-specific down-projection scales."
              },
              "members": []
            },
            {
              "name": "SigmoidScaleAccBatchPush",
              "qualified_name": "SigmoidScaleAccBatchPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SigmoidScaleAccBatchPush = extern struct",
              "anchor": "sigmoid-scale-acc-batch-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#sigmoid-scale-acc-batch-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 215,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L215",
              "doc": {
                "summary": "Push constants for the **batched** `sigmoid_scale_acc` shader.",
                "description": [
                  "Applies a per-token sigmoid-gated shared-expert add across a token batch: `accum[t,i] += sigmoid(gate_t) * src[t,i]`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for the **batched** `sigmoid_scale_acc` shader.\nApplies a per-token sigmoid-gated shared-expert add across a token batch:\n`accum[t,i] += sigmoid(gate_t) * src[t,i]`."
              },
              "members": []
            },
            {
              "name": "KvCacheWritePush",
              "qualified_name": "KvCacheWritePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KvCacheWritePush = extern struct",
              "anchor": "kv-cache-write-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#kv-cache-write-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 222,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L222",
              "doc": {
                "summary": "Push constants for KV cache write compute shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for KV cache write compute shader."
              },
              "members": []
            },
            {
              "name": "KvCacheWriteBatchedPush",
              "qualified_name": "KvCacheWriteBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KvCacheWriteBatchedPush = extern struct",
              "anchor": "kv-cache-write-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#kv-cache-write-batched-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 229,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L229",
              "doc": {
                "summary": "Push constants for batched KV cache write (prefillBatched path).",
                "description": [
                  "Matches src/shaders/kv_cache_write_batched.comp."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for batched KV cache write (prefillBatched path).\nMatches src/shaders/kv_cache_write_batched.comp."
              },
              "members": []
            },
            {
              "name": "ResidualRmsNormPush",
              "qualified_name": "ResidualRmsNormPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ResidualRmsNormPush = extern struct",
              "anchor": "residual-rms-norm-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#residual-rms-norm-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 239,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L239",
              "doc": {
                "summary": "Push constants for fused residual-add + RMS norm (src/shaders/residual_rms_norm.comp).",
                "description": [
                  "One dispatch per `n_tokens` workgroups replaces a scale_accumulate → barrier → rms_norm_mul chain."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused residual-add + RMS norm\n(src/shaders/residual_rms_norm.comp). One dispatch per `n_tokens`\nworkgroups replaces a scale_accumulate → barrier → rms_norm_mul chain."
              },
              "members": []
            },
            {
              "name": "PostNormResidualRmsNormPush",
              "qualified_name": "PostNormResidualRmsNormPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PostNormResidualRmsNormPush = extern struct",
              "anchor": "post-norm-residual-rms-norm-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#post-norm-residual-rms-norm-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 248,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L248",
              "doc": {
                "summary": "Push constants for fused post-norm + residual-add + RMS norm (src/shaders/post_norm_residual_rms_norm.comp).",
                "description": [
                  "One dispatch replaces Gemma's post_attention_norm -> barrier -> residual_rms_norm sequence."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused post-norm + residual-add + RMS norm\n(src/shaders/post_norm_residual_rms_norm.comp). One dispatch replaces\nGemma's post_attention_norm -> barrier -> residual_rms_norm sequence."
              },
              "members": []
            },
            {
              "name": "ResidualRmsNormQuantQ8_1Push",
              "qualified_name": "ResidualRmsNormQuantQ8_1Push",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ResidualRmsNormQuantQ8_1Push = extern struct",
              "anchor": "residual-rms-norm-quant-q8-1-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#residual-rms-norm-quant-q8-1-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 259,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L259",
              "doc": {
                "summary": "Push constants for fused residual-add + RMS norm + Q8_1 activation quantize (src/shaders/residual_rms_norm_quant_q8_1.comp).",
                "description": [
                  "Same residual/RMS math as ResidualRmsNormPush, but also emits packed int8 lanes + (scale, dsum) so the downstream Qwen3.6-27B dense FFN DP4a gate+up GEMM can skip its separate quantize_act_q8_1 dispatch."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused residual-add + RMS norm + Q8_1 activation quantize\n(src/shaders/residual_rms_norm_quant_q8_1.comp). Same residual/RMS math as\nResidualRmsNormPush, but also emits packed int8 lanes + (scale, dsum) so\nthe downstream Qwen3.6-27B dense FFN DP4a gate+up GEMM can skip its\nseparate quantize_act_q8_1 dispatch."
              },
              "members": []
            },
            {
              "name": "NormRopePush",
              "qualified_name": "NormRopePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const NormRopePush = extern struct",
              "anchor": "norm-rope-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#norm-rope-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 269,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L269",
              "doc": {
                "summary": "Push constants for fused RMS norm + RoPE shader.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused RMS norm + RoPE shader."
              },
              "members": []
            },
            {
              "name": "RmsNormAddPush",
              "qualified_name": "RmsNormAddPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RmsNormAddPush = extern struct",
              "anchor": "rms-norm-add-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rms-norm-add-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 282,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L282",
              "doc": {
                "summary": "Push constants for fused rmsnorm(src) + hidden accumulate shader (src/shaders/rms_norm_add.comp).",
                "description": [
                  "Used by Gemma prefillBatched to fold post_ffw_norm + residual add into one dispatch."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused rmsnorm(src) + hidden accumulate shader\n(src/shaders/rms_norm_add.comp). Used by Gemma prefillBatched to fold\npost_ffw_norm + residual add into one dispatch."
              },
              "members": []
            },
            {
              "name": "RmsNormDmmvF32Push",
              "qualified_name": "RmsNormDmmvF32Push",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RmsNormDmmvF32Push = extern struct",
              "anchor": "rms-norm-dmmv-f32-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rms-norm-dmmv-f32-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 291,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L291",
              "doc": {
                "summary": "Push constants for fused RMS norm + f32 router DMMV shader (src/shaders/rms_norm_dmmv_f32.comp).",
                "description": [
                  "Folds the per-MoE-layer rms_norm_mul → router DMMV pair into a single dispatch on architectures whose router weights are f32 (Qwen 3.5/3.6 etc)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused RMS norm + f32 router DMMV shader\n(src/shaders/rms_norm_dmmv_f32.comp). Folds the per-MoE-layer\nrms_norm_mul → router DMMV pair into a single dispatch on\narchitectures whose router weights are f32 (Qwen 3.5/3.6 etc)."
              },
              "members": []
            },
            {
              "name": "RmsNormDmmvQ4kAlphaBetaPush",
              "qualified_name": "RmsNormDmmvQ4kAlphaBetaPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RmsNormDmmvQ4kAlphaBetaPush = extern struct",
              "anchor": "rms-norm-dmmv-q4k-alpha-beta-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#rms-norm-dmmv-q4k-alpha-beta-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 301,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L301",
              "doc": {
                "summary": "Push constants for fused RMS norm + Q4_K alpha+beta SSM proj DMMV (src/shaders/rms_norm_dmmv_q4k_alpha_beta.comp).",
                "description": [
                  "Folds the per-SSM-layer (rms_norm_mul → alpha DMMV → beta DMMV) trio into a single dispatch on the qwen35moe / qwen36moe SSM proj fast path."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused RMS norm + Q4_K alpha+beta SSM proj DMMV\n(src/shaders/rms_norm_dmmv_q4k_alpha_beta.comp). Folds the\nper-SSM-layer (rms_norm_mul → alpha DMMV → beta DMMV) trio into a\nsingle dispatch on the qwen35moe / qwen36moe SSM proj fast path."
              },
              "members": []
            },
            {
              "name": "QkNormRopeKvWritePush",
              "qualified_name": "QkNormRopeKvWritePush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const QkNormRopeKvWritePush = extern struct",
              "anchor": "qk-norm-rope-kv-write-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#qk-norm-rope-kv-write-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 311,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L311",
              "doc": {
                "summary": "Push constants for fused Q+K norm + RoPE + KV cache write shader (src/shaders/qk_norm_rope_kv_write.comp).",
                "description": [
                  "Folds the per-attention-layer (Q norm+rope → K norm+rope → kv_cache_write) trio on Qwen 3 family dense attention into a single dispatch."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Push constants for fused Q+K norm + RoPE + KV cache write shader\n(src/shaders/qk_norm_rope_kv_write.comp). Folds the per-attention-layer\n(Q norm+rope → K norm+rope → kv_cache_write) trio on Qwen 3 family\ndense attention into a single dispatch."
              },
              "members": []
            },
            {
              "name": "QkNormRopeKvWriteBatchedPush",
              "qualified_name": "QkNormRopeKvWriteBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const QkNormRopeKvWriteBatchedPush = extern struct",
              "anchor": "qk-norm-rope-kv-write-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#qk-norm-rope-kv-write-batched-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 327,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L327",
              "doc": {
                "summary": "Batched SWA variant of QkNormRopeKvWritePush.",
                "description": [
                  "Binding 4 is the KV page table, so this variant computes RoPE frequencies from freq_base_bits instead of reading a frequency buffer."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Batched SWA variant of QkNormRopeKvWritePush.\nBinding 4 is the KV page table, so this variant computes RoPE frequencies\nfrom freq_base_bits instead of reading a frequency buffer."
              },
              "members": []
            },
            {
              "name": "KNormRopeKvWriteBatchedPush",
              "qualified_name": "KNormRopeKvWriteBatchedPush",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KNormRopeKvWriteBatchedPush = extern struct",
              "anchor": "knorm-rope-kv-write-batched-push",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#knorm-rope-kv-write-batched-push",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 344,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L344",
              "doc": {
                "summary": "Batched full-attention K/V sibling used when Q must keep the precomputed RoPE frequency buffer binding.",
                "description": [
                  "It fuses K RMS norm, K RoPE, optional V unit norm, and paged KV cache write. Q norm/RoPE stays on the existing path."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Batched full-attention K/V sibling used when Q must keep the precomputed\nRoPE frequency buffer binding. It fuses K RMS norm, K RoPE, optional V unit\nnorm, and paged KV cache write. Q norm/RoPE stays on the existing path."
              },
              "members": []
            },
            {
              "name": "ElementwiseDispatch",
              "qualified_name": "ElementwiseDispatch",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ElementwiseDispatch = struct",
              "anchor": "elementwise-dispatch",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch",
              "source_path": "src/compute/elementwise.zig",
              "source_line": 358,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L358",
              "doc": {
                "summary": "Manages element-wise fused kernel pipelines.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Manages element-wise fused kernel pipelines."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ElementwiseDispatch.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( instance: *const Instance, shader_dir: []const u8, allocator: std.mem.Allocator, ) !ElementwiseDispatch",
                  "anchor": "elementwise-dispatch-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-init",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 503,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L503",
                  "doc": {
                    "summary": "Create the fused element-wise dispatch wrapper and load its shaders.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Directory containing compiled SPIR-V shader binaries."
                      },
                      {
                        "name": "allocator",
                        "description": "Allocator used for temporary pipeline creation state."
                      }
                    ],
                    "returns": "An ElementwiseDispatch ready to record element-wise passes.",
                    "notes": [],
                    "raw": "Create the fused element-wise dispatch wrapper and load its shaders."
                  }
                },
                {
                  "name": "recordRmsNorm",
                  "qualified_name": "ElementwiseDispatch.recordRmsNorm",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordRmsNorm( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, hidden_dim: u32, n_tokens: u32, eps: f32, ) !void",
                  "anchor": "elementwise-dispatch-record-rms-norm",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-rms-norm",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 988,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L988",
                  "doc": {
                    "summary": "Record an RMS-norm-plus-scale dispatch for a batch of tokens.",
                    "description": [
                      "This binds the fused normalization shader used before attention and MLP projections so each token is normalized against its hidden dimension."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the RMS norm pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set containing input, weight, and output buffers."
                      },
                      {
                        "name": "hidden_dim",
                        "description": "Hidden width processed per token."
                      },
                      {
                        "name": "n_tokens",
                        "description": "Number of tokens covered by the dispatch."
                      },
                      {
                        "name": "eps",
                        "description": "Numerical stability epsilon passed to the shader."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the RMS norm pipeline is unavailable.",
                    "notes": [
                      "The helper dispatches one workgroup per token."
                    ],
                    "raw": "Record an RMS-norm-plus-scale dispatch for a batch of tokens.\n\nThis binds the fused normalization shader used before attention and MLP\nprojections so each token is normalized against its hidden dimension."
                  }
                },
                {
                  "name": "recordSwiglu",
                  "qualified_name": "ElementwiseDispatch.recordSwiglu",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSwiglu( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-swiglu",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-swiglu",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1014,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1014",
                  "doc": {
                    "summary": "Record a SwiGLU activation dispatch.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SwiGLU pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set containing gate, up, and output buffers."
                      },
                      {
                        "name": "n_elements",
                        "description": "Total number of output elements to compute."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SwiGLU pipeline is unavailable.",
                    "notes": [
                      "Workgroups are sized as `ceil(n_elements / 64)`."
                    ],
                    "raw": "Record a SwiGLU activation dispatch."
                  }
                },
                {
                  "name": "recordSwigluOai",
                  "qualified_name": "ElementwiseDispatch.recordSwigluOai",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSwigluOai( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-swiglu-oai",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-swiglu-oai",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1036,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1036",
                  "doc": {
                    "summary": "Record a GPT-OSS / OAI-variant SwiGLU activation dispatch.",
                    "description": [
                      "Uses the same 3-binding layout as `recordSwiglu` (gate, up → output) but selects the swiglu_oai shader whose activation function matches gpt-oss."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the OAI SwiGLU pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set containing gate, up, and output buffers."
                      },
                      {
                        "name": "n_elements",
                        "description": "Total number of output elements to compute."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the OAI SwiGLU pipeline is unavailable.",
                    "notes": [
                      "Workgroups are sized as `ceil(n_elements / 64)`."
                    ],
                    "raw": "Record a GPT-OSS / OAI-variant SwiGLU activation dispatch.\nUses the same 3-binding layout as `recordSwiglu` (gate, up → output) but\nselects the swiglu_oai shader whose activation function matches gpt-oss."
                  }
                },
                {
                  "name": "recordBiasAdd",
                  "qualified_name": "ElementwiseDispatch.recordBiasAdd",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordBiasAdd( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, src_offset: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-bias-add",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-bias-add",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1055,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1055",
                  "doc": {
                    "summary": "Record an in-place bias add dispatch: `out[i] += bias[src_offset + i]`.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the bias add pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with two bindings: output buffer (rw) and bias buffer (ro)."
                      },
                      {
                        "name": "n_elements",
                        "description": "Number of elements to update."
                      },
                      {
                        "name": "src_offset",
                        "description": "Element offset into the bias buffer (allows a shared bias tensor to be sliced)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the bias add pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an in-place bias add dispatch: `out[i] += bias[src_offset + i]`."
                  }
                },
                {
                  "name": "recordGeglu",
                  "qualified_name": "ElementwiseDispatch.recordGeglu",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordGeglu( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-geglu",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-geglu",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1073,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1073",
                  "doc": {
                    "summary": "Record a GEGLU activation dispatch (GELU-gated, used by Gemma).",
                    "description": [
                      "Same buffer layout as SwiGLU: gate, up → output."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a GEGLU activation dispatch (GELU-gated, used by Gemma).\nSame buffer layout as SwiGLU: gate, up → output."
                  }
                },
                {
                  "name": "recordRope",
                  "qualified_name": "ElementwiseDispatch.recordRope",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordRope( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, stride: u32, rope_dim: u32, n_heads: u32, position: u32, freq_base: f32, attn_scale: f32, ) !void",
                  "anchor": "elementwise-dispatch-record-rope",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-rope",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1099,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1099",
                  "doc": {
                    "summary": "Record a RoPE dispatch with partial rotation support (IMRoPE).",
                    "description": [
                      "Rotates the first `rope_dim` dimensions of each attention head at the given sequence position; the remaining `stride - rope_dim` dimensions are copied unchanged, enabling interleaved-masked (IMRoPE) layouts."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the RoPE pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with three bindings: input, output, and freq buffer."
                      },
                      {
                        "name": "stride",
                        "description": "Full head dimension in f32 elements (distance between heads in the buffer)."
                      },
                      {
                        "name": "rope_dim",
                        "description": "Number of dimensions to rotate (must be <= stride; pass stride for plain RoPE)."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads to rotate; one workgroup is dispatched per head."
                      },
                      {
                        "name": "position",
                        "description": "Current decode token position used to compute rotation angles."
                      },
                      {
                        "name": "freq_base",
                        "description": "Base frequency for the sinusoidal schedule (e.g. 10000.0 for standard RoPE)."
                      },
                      {
                        "name": "attn_scale",
                        "description": "YaRN magnitude scale applied after rotation; use 1.0 for plain RoPE."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the RoPE pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record a RoPE dispatch with partial rotation support (IMRoPE).\nRotates the first `rope_dim` dimensions of each attention head at the\ngiven sequence position; the remaining `stride - rope_dim` dimensions\nare copied unchanged, enabling interleaved-masked (IMRoPE) layouts."
                  }
                },
                {
                  "name": "recordRoPEBatched",
                  "qualified_name": "ElementwiseDispatch.recordRoPEBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordRoPEBatched( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, stride: u32, rope_dim: u32, n_heads: u32, position_base: u32, n_tokens: u32, freq_base: f32, attn_scale: f32, ) !void",
                  "anchor": "elementwise-dispatch-record-ro-pebatched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ro-pebatched",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1130,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1130",
                  "doc": {
                    "summary": "Record a batched RoPE dispatch that rotates N tokens at consecutive positions [position_base, position_base + n_tokens) in a single call.",
                    "description": [
                      "Grid is (n_heads, n_tokens, 1); each (head, token) workgroup rotates `rope_dim` elements of the token's head slice."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a batched RoPE dispatch that rotates N tokens at consecutive\npositions [position_base, position_base + n_tokens) in a single call.\nGrid is (n_heads, n_tokens, 1); each (head, token) workgroup rotates\n`rope_dim` elements of the token's head slice."
                  }
                },
                {
                  "name": "recordDeinterleave",
                  "qualified_name": "ElementwiseDispatch.recordDeinterleave",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordDeinterleave( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-deinterleave",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-deinterleave",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1155,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1155",
                  "doc": {
                    "summary": "Record a deinterleave dispatch: split element-interleaved Q+gate into separate buffers.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a deinterleave dispatch: split element-interleaved Q+gate into separate buffers."
                  }
                },
                {
                  "name": "recordDeinterleaveBatched",
                  "qualified_name": "ElementwiseDispatch.recordDeinterleaveBatched",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordDeinterleaveBatched( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, head_dim: u32, n_heads: u32, n_tokens: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-deinterleave-batched",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-deinterleave-batched",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1183,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1183",
                  "doc": {
                    "summary": "Record a token-batched deinterleave dispatch.",
                    "description": [
                      "Splits each token's packed `[Q(head_dim), gate(head_dim)]` interleaved per-head layout into separate Q and gate output buffers in one dispatch. Grid is `(ceil(head_dim * n_heads / 64), n_tokens, 1)`."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the batched deinterleave pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 3 bindings: packed input, Q output, gate output."
                      },
                      {
                        "name": "head_dim",
                        "description": "Per-head dimension in elements."
                      },
                      {
                        "name": "n_heads",
                        "description": "Number of query heads per token."
                      },
                      {
                        "name": "n_tokens",
                        "description": "Number of tokens to process (Y dimension of the dispatch grid)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the batched deinterleave pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record a token-batched deinterleave dispatch.\nSplits each token's packed `[Q(head_dim), gate(head_dim)]` interleaved\nper-head layout into separate Q and gate output buffers in one dispatch.\nGrid is `(ceil(head_dim * n_heads / 64), n_tokens, 1)`."
                  }
                },
                {
                  "name": "recordSigmoidMul",
                  "qualified_name": "ElementwiseDispatch.recordSigmoidMul",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSigmoidMul( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-sigmoid-mul",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-sigmoid-mul",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1199,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1199",
                  "doc": {
                    "summary": "Record a sigmoid multiply dispatch: out = input * sigmoid(gate).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a sigmoid multiply dispatch: out = input * sigmoid(gate)."
                  }
                },
                {
                  "name": "recordVadd",
                  "qualified_name": "ElementwiseDispatch.recordVadd",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordVadd( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-vadd",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-vadd",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1213,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1213",
                  "doc": {
                    "summary": "Record a vector add dispatch: c = a + b.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a vector add dispatch: c = a + b."
                  }
                },
                {
                  "name": "recordScaleAcc",
                  "qualified_name": "ElementwiseDispatch.recordScaleAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordScaleAcc( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, scale: f32, ) !void",
                  "anchor": "elementwise-dispatch-record-scale-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-scale-acc",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1229,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1229",
                  "doc": {
                    "summary": "Record a scale-accumulate dispatch: a[i] += scale * b[i].",
                    "description": [
                      "Vec4-coalesced: each thread handles one vec4 (4 f32 elements). Caller must pass n_elements divisible by 4; every in-tree caller already does."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record a scale-accumulate dispatch: a[i] += scale * b[i].\nVec4-coalesced: each thread handles one vec4 (4 f32 elements). Caller\nmust pass n_elements divisible by 4; every in-tree caller already does."
                  }
                },
                {
                  "name": "recordScaleInPlace",
                  "qualified_name": "ElementwiseDispatch.recordScaleInPlace",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordScaleInPlace( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, scale: f32, ) !void",
                  "anchor": "elementwise-dispatch-record-scale-in-place",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-scale-in-place",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1250,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1250",
                  "doc": {
                    "summary": "Record an in-place element-wise scale dispatch: `data[i] *= scale`.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the scale-in-place pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with one binding: the buffer to scale in place."
                      },
                      {
                        "name": "n_elements",
                        "description": "Number of f32 elements to scale."
                      },
                      {
                        "name": "scale",
                        "description": "Scalar multiplier applied to every element."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the scale-in-place pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an in-place element-wise scale dispatch: `data[i] *= scale`."
                  }
                },
                {
                  "name": "recordSsmConv1d",
                  "qualified_name": "ElementwiseDispatch.recordSsmConv1d",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmConv1d( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, conv_channels: u32, d_conv: u32, kernel_is_f16: bool, state_offset: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-conv1d",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-conv1d",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1275,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1275",
                  "doc": {
                    "summary": "Record a single-token SSM depthwise conv1d + SiLU dispatch.",
                    "description": [
                      "Reads the current SSM conv state via `state_offset` (a rotating index into the circular state buffer), applies a depthwise conv kernel of width `d_conv`, and writes the SiLU-activated output in-place."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM conv1d pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with four bindings: input, kernel, state, output."
                      },
                      {
                        "name": "conv_channels",
                        "description": "Number of SSM channels (width of the depthwise conv)."
                      },
                      {
                        "name": "d_conv",
                        "description": "Kernel width of the depthwise convolution."
                      },
                      {
                        "name": "kernel_is_f16",
                        "description": "True when the kernel weight buffer is f16; false for f32."
                      },
                      {
                        "name": "state_offset",
                        "description": "Current rotation index (0..d_conv-2) into the circular state buffer."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM conv1d pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record a single-token SSM depthwise conv1d + SiLU dispatch.\nReads the current SSM conv state via `state_offset` (a rotating index into\nthe circular state buffer), applies a depthwise conv kernel of width\n`d_conv`, and writes the SiLU-activated output in-place."
                  }
                },
                {
                  "name": "recordSsmQkNorm",
                  "qualified_name": "ElementwiseDispatch.recordSsmQkNorm",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmQkNorm( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, d_state: u32, n_group: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-qk-norm",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-qk-norm",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1304,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1304",
                  "doc": {
                    "summary": "Record an in-place SSM Q/K RMS-norm dispatch.",
                    "description": [
                      "Applies per-group RMS normalization to the concatenated Q and K projections inside a Mamba/DeltaNet SSM block; dispatches one workgroup per group."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM Q/K norm pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with one binding: the Q+K buffer (in-place)."
                      },
                      {
                        "name": "d_state",
                        "description": "Per-group state dimension (qk_dim = d_state * n_group)."
                      },
                      {
                        "name": "n_group",
                        "description": "Number of normalization groups; one workgroup per group."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM Q/K norm pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an in-place SSM Q/K RMS-norm dispatch.\nApplies per-group RMS normalization to the concatenated Q and K projections\ninside a Mamba/DeltaNet SSM block; dispatches one workgroup per group."
                  }
                },
                {
                  "name": "recordSsmDeltaNet",
                  "qualified_name": "ElementwiseDispatch.recordSsmDeltaNet",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmDeltaNet( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, push: SsmDeltaNetPush, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-delta-net",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-delta-net",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1329,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1329",
                  "doc": {
                    "summary": "Record an SSM DeltaNet state-update dispatch (baseline variant).",
                    "description": [
                      "Executes the DeltaNet recurrence over a single token (or `push.n_tok` prefill tokens when n_tok > 1). Grid is `(dt_rank, head_v_dim, 1)` — one wave64 workgroup per (head, row) pair."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM delta-net pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 7 bindings: conv_out, dt_bias, alpha, beta, ssm_a, state, output."
                      },
                      {
                        "name": "push",
                        "description": "Fully populated push-constant struct describing the SSM dimensions and flags."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM delta-net pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an SSM DeltaNet state-update dispatch (baseline variant).\nExecutes the DeltaNet recurrence over a single token (or `push.n_tok`\nprefill tokens when n_tok > 1).  Grid is `(dt_rank, head_v_dim, 1)` —\none wave64 workgroup per (head, row) pair."
                  }
                },
                {
                  "name": "recordSsmDeltaNetCols8",
                  "qualified_name": "ElementwiseDispatch.recordSsmDeltaNetCols8",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmDeltaNetCols8( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, push: SsmDeltaNetPush, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-delta-net-cols8",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-delta-net-cols8",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1349,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1349",
                  "doc": {
                    "summary": "Record an SSM DeltaNet state-update dispatch using the cols8 tiled variant.",
                    "description": [
                      "Each wave64 workgroup processes four output rows (head_v_dim / 4 workgroups per head), improving register reuse relative to the baseline 1-row shader."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM delta-net cols8 pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 7 bindings (same layout as `recordSsmDeltaNet`)."
                      },
                      {
                        "name": "push",
                        "description": "Fully populated push-constant struct describing the SSM dimensions and flags."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM delta-net cols8 pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an SSM DeltaNet state-update dispatch using the cols8 tiled variant.\nEach wave64 workgroup processes four output rows (head_v_dim / 4 workgroups\nper head), improving register reuse relative to the baseline 1-row shader."
                  }
                },
                {
                  "name": "recordSsmDeltaNetCols8Normed",
                  "qualified_name": "ElementwiseDispatch.recordSsmDeltaNetCols8Normed",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmDeltaNetCols8Normed( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, push: SsmDeltaNetPush, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-delta-net-cols8-normed",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-delta-net-cols8-normed",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1370,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1370",
                  "doc": {
                    "summary": "Record an SSM DeltaNet state-update dispatch using the cols8 normed variant.",
                    "description": [
                      "Identical semantics to `recordSsmDeltaNetCols8` but selects the shader that expects Q/K inputs to be pre-normalized (skipping the in-shader norm). Each wave64 workgroup processes eight output rows (head_v_dim / 8 workgroups per head)."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM delta-net cols8 normed pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 7 bindings (same layout as `recordSsmDeltaNet`)."
                      },
                      {
                        "name": "push",
                        "description": "Fully populated push-constant struct describing the SSM dimensions and flags."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM delta-net cols8 normed pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an SSM DeltaNet state-update dispatch using the cols8 normed variant.\nIdentical semantics to `recordSsmDeltaNetCols8` but selects the shader\nthat expects Q/K inputs to be pre-normalized (skipping the in-shader norm).\nEach wave64 workgroup processes eight output rows (head_v_dim / 8 workgroups per head)."
                  }
                },
                {
                  "name": "recordSsmGatedNorm",
                  "qualified_name": "ElementwiseDispatch.recordSsmGatedNorm",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSsmGatedNorm( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, push: SsmGatedNormPush, ) !void",
                  "anchor": "elementwise-dispatch-record-ssm-gated-norm",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-ssm-gated-norm",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1388,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1388",
                  "doc": {
                    "summary": "Record an SSM gated norm dispatch: applies z-gate * RMS-norm(delta_output).",
                    "description": [
                      "Dispatches one wave64 workgroup per head (`push.dt_rank` workgroups total)."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the SSM gated norm pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 4 bindings: delta_output, z_gate, norm_weights, output."
                      },
                      {
                        "name": "push",
                        "description": "Push-constant struct specifying d_inner, dt_rank, head_v_dim, d_state, and norm_per_head."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the SSM gated norm pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record an SSM gated norm dispatch: applies z-gate * RMS-norm(delta_output).\nDispatches one wave64 workgroup per head (`push.dt_rank` workgroups total)."
                  }
                },
                {
                  "name": "recordSoftmaxTopk",
                  "qualified_name": "ElementwiseDispatch.recordSoftmaxTopk",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSoftmaxTopk( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_experts: u32, k: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-softmax-topk",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-softmax-topk",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1399,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1399",
                  "doc": {
                    "summary": "Record softmax + top-k MoE router dispatch.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record softmax + top-k MoE router dispatch."
                  }
                },
                {
                  "name": "recordSigmoidScaleAcc",
                  "qualified_name": "ElementwiseDispatch.recordSigmoidScaleAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordSigmoidScaleAcc( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-sigmoid-scale-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-sigmoid-scale-acc",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1412,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1412",
                  "doc": {
                    "summary": "Record sigmoid-gated scale-accumulate: a[i] += sigmoid(c[0]) * b[i].",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record sigmoid-gated scale-accumulate: a[i] += sigmoid(c[0]) * b[i]."
                  }
                },
                {
                  "name": "recordMoeWeightedAcc",
                  "qualified_name": "ElementwiseDispatch.recordMoeWeightedAcc",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recordMoeWeightedAcc( self: *const ElementwiseDispatch, cmd: *CommandBuffer, descriptor_set: vk.c.VkDescriptorSet, n_elements: u32, n_used: u32, src_stride: u32, ) !void",
                  "anchor": "elementwise-dispatch-record-moe-weighted-acc",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-record-moe-weighted-acc",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1435,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1435",
                  "doc": {
                    "summary": "Record a MoE weighted accumulate dispatch: `a[i] += routing_weight[j] * b[j*src_stride + i]` summed over `n_used` selected experts.",
                    "description": [
                      "Routing weights are read from the GPU routing buffer (binding 2), not from a push constant."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper containing the MoE weighted accumulate pipeline."
                      },
                      {
                        "name": "cmd",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set with 3 bindings: accum (rw), src experts, routing weights."
                      },
                      {
                        "name": "n_elements",
                        "description": "Hidden dimension of the accumulation buffer (elements updated per token)."
                      },
                      {
                        "name": "n_used",
                        "description": "Number of selected experts whose outputs are summed."
                      },
                      {
                        "name": "src_stride",
                        "description": "Elements per expert in the source buffer (typically equal to n_elements)."
                      }
                    ],
                    "returns": "`error.ShaderNotLoaded` when the MoE weighted accumulate pipeline is unavailable.",
                    "notes": [],
                    "raw": "Record a MoE weighted accumulate dispatch: `a[i] += routing_weight[j] * b[j*src_stride + i]`\nsummed over `n_used` selected experts.  Routing weights are read from the GPU\nrouting buffer (binding 2), not from a push constant."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ElementwiseDispatch.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ElementwiseDispatch) void",
                  "anchor": "elementwise-dispatch-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/elementwise/#elementwise-dispatch-deinit",
                  "source_path": "src/compute/elementwise.zig",
                  "source_line": 1451,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/compute/elementwise.zig#L1451",
                  "doc": {
                    "summary": "Destroy the loaded pipelines and descriptor pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Dispatch wrapper to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the loaded pipelines and descriptor pool."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "runtime-assets",
          "title": "Runtime Assets",
          "section": "Shader Dispatch",
          "summary": "Runtime asset discovery for installed and source-tree ZINC layouts.",
          "overview": [
            "Release archives place shader assets next to the executable under `share/zinc/shaders`, while development builds often run from the repository with assets under `zig-out` or `src/shaders`. This module centralizes that lookup and keeps backend code from hardcoding source-checkout paths."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime-assets/",
          "source_path": "src/runtime_assets.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/runtime_assets.zig#L10",
          "counts": {
            "code_lines": 130,
            "exports": 3,
            "methods": 0,
            "symbols": 3
          },
          "symbols": [
            {
              "name": "ShaderKind",
              "qualified_name": "ShaderKind",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const ShaderKind = enum",
              "anchor": "shader-kind",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime-assets/#shader-kind",
              "source_path": "src/runtime_assets.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/runtime_assets.zig#L10",
              "doc": {
                "summary": "Which compiled shader family to locate.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Which compiled shader family to locate."
              },
              "members": []
            },
            {
              "name": "resolveShaderDir",
              "qualified_name": "resolveShaderDir",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveShaderDir(allocator: std.mem.Allocator, kind: ShaderKind) ![]u8",
              "anchor": "resolve-shader-dir",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime-assets/#resolve-shader-dir",
              "source_path": "src/runtime_assets.zig",
              "source_line": 37,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/runtime_assets.zig#L37",
              "doc": {
                "summary": "Resolve the directory holding compiled shaders of `kind`, honoring `ZINC_SHADER_DIR`.",
                "description": [
                  "Checks the `ZINC_SHADER_DIR` environment override first, then falls back to the executable-relative install layout and the in-tree development paths. or `error.ShaderDirNotFound` when no known layout exists."
                ],
                "params": [
                  {
                    "name": "allocator",
                    "description": "Allocator for the returned path; the caller owns the result."
                  },
                  {
                    "name": "kind",
                    "description": "Shader family to locate (SPIR-V or Metal)."
                  }
                ],
                "returns": "Newly allocated path to the shader directory.",
                "notes": [
                  "Returns `error.ShaderDirOverrideNotFound` when the override is set but absent,"
                ],
                "raw": "Resolve the directory holding compiled shaders of `kind`, honoring `ZINC_SHADER_DIR`.\n\nChecks the `ZINC_SHADER_DIR` environment override first, then falls back to the\nexecutable-relative install layout and the in-tree development paths.\nor `error.ShaderDirNotFound` when no known layout exists."
              },
              "members": []
            },
            {
              "name": "resolveShaderDirFrom",
              "qualified_name": "resolveShaderDirFrom",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveShaderDirFrom( allocator: std.mem.Allocator, base_dir: std.fs.Dir, exe_dir_override: ?[]const u8, kind: ShaderKind, ) ![]u8",
              "anchor": "resolve-shader-dir-from",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime-assets/#resolve-shader-dir-from",
              "source_path": "src/runtime_assets.zig",
              "source_line": 55,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/runtime_assets.zig#L55",
              "doc": {
                "summary": "Resolve the shader directory against explicit base/exe dirs — the testable core of `resolveShaderDir`.",
                "description": [
                  "Tries the executable-relative install layout first, then the working-directory candidates for the requested shader family."
                ],
                "params": [
                  {
                    "name": "allocator",
                    "description": "Allocator for the returned path; the caller owns the result."
                  },
                  {
                    "name": "base_dir",
                    "description": "Directory the cwd-relative candidates are resolved against."
                  },
                  {
                    "name": "exe_dir_override",
                    "description": "Optional executable directory; when null the real exe path is queried."
                  },
                  {
                    "name": "kind",
                    "description": "Shader family to locate (SPIR-V or Metal)."
                  }
                ],
                "returns": "Newly allocated path to the shader directory.",
                "notes": [
                  "Returns `error.ShaderDirNotFound` when no known layout exists."
                ],
                "raw": "Resolve the shader directory against explicit base/exe dirs — the testable core of `resolveShaderDir`.\n\nTries the executable-relative install layout first, then the working-directory\ncandidates for the requested shader family."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "hardware-detection",
      "title": "Hardware Detection",
      "description": "Vendor and architecture heuristics that translate raw Vulkan properties into tuning defaults for AMD, NVIDIA, and Intel GPUs.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#hardware-detection",
      "module_count": 3,
      "symbol_count": 15,
      "modules": [
        {
          "slug": "diagnostics-metal",
          "title": "Diagnostics Metal",
          "section": "Hardware Detection",
          "summary": "Apple Silicon diagnostics and managed-model fit reporting for Metal.",
          "overview": [
            "The Metal diagnostics path inspects the default device, reports unified memory and feature support, and optionally projects how a selected GGUF or managed model fits once runtime allocations and KV reservation are included."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/",
          "source_path": "src/diagnostics_metal.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L22",
          "counts": {
            "code_lines": 665,
            "exports": 5,
            "methods": 0,
            "symbols": 5
          },
          "symbols": [
            {
              "name": "Options",
              "qualified_name": "Options",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Options = struct",
              "anchor": "options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/#options",
              "source_path": "src/diagnostics_metal.zig",
              "source_line": 22,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L22",
              "doc": {
                "summary": "Configuration for a Metal diagnostics run.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Configuration for a Metal diagnostics run."
              },
              "members": []
            },
            {
              "name": "ManagedModelInfo",
              "qualified_name": "ManagedModelInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ManagedModelInfo = struct",
              "anchor": "managed-model-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/#managed-model-info",
              "source_path": "src/diagnostics_metal.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L36",
              "doc": {
                "summary": "Catalog metadata for a managed (downloadable) model.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Catalog metadata for a managed (downloadable) model."
              },
              "members": []
            },
            {
              "name": "UnifiedFitEstimate",
              "qualified_name": "UnifiedFitEstimate",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const UnifiedFitEstimate = struct",
              "anchor": "unified-fit-estimate",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/#unified-fit-estimate",
              "source_path": "src/diagnostics_metal.zig",
              "source_line": 120,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L120",
              "doc": {
                "summary": "Estimated unified-memory breakdown for running a model on Apple Silicon.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Estimated unified-memory breakdown for running a model on Apple Silicon."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(opts: Options, allocator: std.mem.Allocator) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/#run",
              "source_path": "src/diagnostics_metal.zig",
              "source_line": 199,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L199",
              "doc": {
                "summary": "Run a four-step Metal preflight check (host environment, device, shader assets, model) and print a colour-coded report to stdout.",
                "description": [
                  "The steps are: (1) host OS and CPU arch, (2) Metal device capabilities and unified-memory budget, (3) shader source presence and MSL smoke compile, (4) GGUF or managed-model memory-fit estimate. Returns `error.DiagnosticsFailed` if any check resolves to `.fail`."
                ],
                "params": [
                  {
                    "name": "opts",
                    "description": "Diagnostic configuration: optional model path, context ceiling, managed-model entry, and shader directory."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for Metal device initialisation and GGUF header inspection."
                  }
                ],
                "returns": "`error.DiagnosticsFailed` when one or more checks emit a FAIL status; otherwise succeeds or propagates I/O errors.",
                "notes": [],
                "raw": "Run a four-step Metal preflight check (host environment, device, shader assets, model) and print a colour-coded report to stdout.\n\nThe steps are: (1) host OS and CPU arch, (2) Metal device capabilities and\nunified-memory budget, (3) shader source presence and MSL smoke compile,\n(4) GGUF or managed-model memory-fit estimate.  Returns `error.DiagnosticsFailed`\nif any check resolves to `.fail`."
              },
              "members": []
            },
            {
              "name": "estimateUnifiedFit",
              "qualified_name": "estimateUnifiedFit",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn estimateUnifiedFit( inspection: ModelInspection, recommended_working_set_bytes: u64, total_memory_bytes: u64, requested_context_length: ?u32, ) UnifiedFitEstimate",
              "anchor": "estimate-unified-fit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics-metal/#estimate-unified-fit",
              "source_path": "src/diagnostics_metal.zig",
              "source_line": 490,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics_metal.zig#L490",
              "doc": {
                "summary": "Compute a conservative unified-memory breakdown for running a model on Apple Silicon.",
                "description": [
                  "Combines tensor weight bytes with the runtime shared-buffer and KV-cache cost at the resolved context length, then determines how many tokens could fit within the Metal working-set budget."
                ],
                "params": [
                  {
                    "name": "inspection",
                    "description": "GGUF model inspection result supplying tensor size and model config."
                  },
                  {
                    "name": "recommended_working_set_bytes",
                    "description": "Metal driver's recommended working-set ceiling; falls back to `total_memory_bytes` when zero."
                  },
                  {
                    "name": "total_memory_bytes",
                    "description": "Physical unified memory on the device."
                  },
                  {
                    "name": "requested_context_length",
                    "description": "Optional caller-supplied context cap; when null the model's own `context_length` is used (clamped by the backend runtime cap)."
                  }
                ],
                "returns": "A `UnifiedFitEstimate` with per-category byte breakdowns and derived fit status fields.",
                "notes": [],
                "raw": "Compute a conservative unified-memory breakdown for running a model on Apple Silicon.\n\nCombines tensor weight bytes with the runtime shared-buffer and KV-cache\ncost at the resolved context length, then determines how many tokens could\nfit within the Metal working-set budget."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "diagnostics",
          "title": "Diagnostics",
          "section": "Hardware Detection",
          "summary": "Vulkan system diagnostics (`zinc --check`).",
          "overview": [
            "Probes the host environment, Vulkan driver, GPU capabilities, shader assets, and optional GGUF model fit to produce a human-readable preflight report on stdout."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/",
          "source_path": "src/diagnostics.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L20",
          "counts": {
            "code_lines": 853,
            "exports": 5,
            "methods": 0,
            "symbols": 5
          },
          "symbols": [
            {
              "name": "Options",
              "qualified_name": "Options",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Options = struct",
              "anchor": "options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/#options",
              "source_path": "src/diagnostics.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L20",
              "doc": {
                "summary": "Configuration for a Vulkan diagnostics run.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Configuration for a Vulkan diagnostics run."
              },
              "members": []
            },
            {
              "name": "ManagedModelInfo",
              "qualified_name": "ManagedModelInfo",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ManagedModelInfo = struct",
              "anchor": "managed-model-info",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/#managed-model-info",
              "source_path": "src/diagnostics.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L34",
              "doc": {
                "summary": "Catalog metadata for a managed (downloadable) model.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Catalog metadata for a managed (downloadable) model."
              },
              "members": []
            },
            {
              "name": "FitEstimate",
              "qualified_name": "FitEstimate",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const FitEstimate = struct",
              "anchor": "fit-estimate",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/#fit-estimate",
              "source_path": "src/diagnostics.zig",
              "source_line": 125,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L125",
              "doc": {
                "summary": "Estimated VRAM breakdown for running a model on a discrete GPU.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Estimated VRAM breakdown for running a model on a discrete GPU."
              },
              "members": []
            },
            {
              "name": "run",
              "qualified_name": "run",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn run(opts: Options, allocator: std.mem.Allocator) !void",
              "anchor": "run",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/#run",
              "source_path": "src/diagnostics.zig",
              "source_line": 195,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L195",
              "doc": {
                "summary": "Run the five-step preflight diagnostics sequence and print a human-readable report to stdout.",
                "description": [
                  "Probes host OS, Vulkan driver, compiled shader assets, GPU device capabilities, and (optionally) a GGUF model file. Returns `error.DiagnosticsFailed` if any check is marked FAIL."
                ],
                "params": [
                  {
                    "name": "opts",
                    "description": "Diagnostic configuration: device index, optional model path, shader dir, etc."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for Vulkan device enumeration and model inspection scratch space."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Run the five-step preflight diagnostics sequence and print a human-readable report to stdout.\nProbes host OS, Vulkan driver, compiled shader assets, GPU device capabilities, and\n(optionally) a GGUF model file. Returns `error.DiagnosticsFailed` if any check is marked FAIL."
              },
              "members": []
            },
            {
              "name": "estimateFit",
              "qualified_name": "estimateFit",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn estimateFit(inspection: ModelInspection, vram_budget_bytes: u64, requested_context_length: ?u32) FitEstimate",
              "anchor": "estimate-fit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/diagnostics/#estimate-fit",
              "source_path": "src/diagnostics.zig",
              "source_line": 737,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/diagnostics.zig#L737",
              "doc": {
                "summary": "Compute a `FitEstimate` that breaks down VRAM usage for a model at a given budget.",
                "description": [
                  "Derives weights, KV cache, SSM state, and runtime buffer sizes from the model config and returns per-category byte counts without evaluating fit status."
                ],
                "params": [
                  {
                    "name": "inspection",
                    "description": "GGUF model inspection result supplying tensor byte count and config."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Device-local VRAM available, as reported by the Vulkan driver."
                  },
                  {
                    "name": "requested_context_length",
                    "description": "Optional context ceiling override; null uses the model default."
                  }
                ],
                "returns": "A `FitEstimate` with per-category byte counts and a budget-headroom context maximum.",
                "notes": [],
                "raw": "Compute a `FitEstimate` that breaks down VRAM usage for a model at a given budget.\nDerives weights, KV cache, SSM state, and runtime buffer sizes from the model config\nand returns per-category byte counts without evaluating fit status."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "gpu-detect",
          "title": "GPU Detect",
          "section": "Hardware Detection",
          "summary": "Inspect the selected Vulkan device and derive architecture-specific tuning defaults.",
          "overview": [
            "The heuristics here convert raw Vulkan device properties into the settings used by DMMV, matmul, and attention dispatch code."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/",
          "source_path": "src/vulkan/gpu_detect.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L13",
          "counts": {
            "code_lines": 293,
            "exports": 3,
            "methods": 2,
            "symbols": 5
          },
          "symbols": [
            {
              "name": "GpuVendor",
              "qualified_name": "GpuVendor",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const GpuVendor = enum",
              "anchor": "gpu-vendor",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/#gpu-vendor",
              "source_path": "src/vulkan/gpu_detect.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L13",
              "doc": {
                "summary": "GPU vendor and architecture buckets used by ZINC's tuning heuristics.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "GPU vendor and architecture buckets used by ZINC's tuning heuristics."
              },
              "members": []
            },
            {
              "name": "GpuConfig",
              "qualified_name": "GpuConfig",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GpuConfig = struct",
              "anchor": "gpu-config",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/#gpu-config",
              "source_path": "src/vulkan/gpu_detect.zig",
              "source_line": 32,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L32",
              "doc": {
                "summary": "Auto-detected GPU capabilities and derived tuning parameters.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Auto-detected GPU capabilities and derived tuning parameters."
              },
              "members": [
                {
                  "name": "nameSlice",
                  "qualified_name": "GpuConfig.nameSlice",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn nameSlice(self: *const GpuConfig) []const u8",
                  "anchor": "gpu-config-name-slice",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/#gpu-config-name-slice",
                  "source_path": "src/vulkan/gpu_detect.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L72",
                  "doc": {
                    "summary": "Return the device name as a byte slice covering only the populated prefix.",
                    "description": [],
                    "params": [],
                    "returns": "A slice of `device_name[0..device_name_len]`; no null terminator or padding included.",
                    "notes": [],
                    "raw": "Return the device name as a byte slice covering only the populated prefix."
                  }
                },
                {
                  "name": "log_info",
                  "qualified_name": "GpuConfig.log_info",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn log_info(self: *const GpuConfig) void",
                  "anchor": "gpu-config-log-info",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/#gpu-config-log-info",
                  "source_path": "src/vulkan/gpu_detect.zig",
                  "source_line": 77,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L77",
                  "doc": {
                    "summary": "Log the detected GPU name, vendor, memory, wave size, cooperative-matrix support, and all derived tuning parameters at info level.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Log the detected GPU name, vendor, memory, wave size, cooperative-matrix support, and all derived tuning parameters at info level."
                  }
                }
              ]
            },
            {
              "name": "detect",
              "qualified_name": "detect",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn detect(instance: *const Instance) GpuConfig",
              "anchor": "detect",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/gpu-detect/#detect",
              "source_path": "src/vulkan/gpu_detect.zig",
              "source_line": 97,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/gpu_detect.zig#L97",
              "doc": {
                "summary": "Inspect Vulkan device properties and derive runtime tuning defaults.",
                "description": [],
                "params": [
                  {
                    "name": "instance",
                    "description": "Active Vulkan instance whose selected physical device should be classified."
                  }
                ],
                "returns": "A GpuConfig populated from Vulkan limits plus ZINC-specific vendor heuristics.",
                "notes": [
                  "The classification is heuristic and intentionally biased toward sensible defaults rather than exact SKU detection."
                ],
                "raw": "Inspect Vulkan device properties and derive runtime tuning defaults."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "vulkan-runtime",
      "title": "Vulkan Runtime",
      "description": "Low-level Vulkan setup, memory allocation, buffers, pipelines, and command submission primitives used throughout the engine.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#vulkan-runtime",
      "module_count": 5,
      "symbol_count": 55,
      "modules": [
        {
          "slug": "buffer",
          "title": "Buffer",
          "section": "Vulkan Runtime",
          "summary": "Allocate Vulkan buffers used by weights, intermediates, and staging copies.",
          "overview": [
            "These helpers centralize buffer creation, memory mapping, and one-shot copy utilities so the rest of the runtime can work with higher-level abstractions."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/",
          "source_path": "src/vulkan/buffer.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L12",
          "counts": {
            "code_lines": 169,
            "exports": 2,
            "methods": 6,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "Buffer",
              "qualified_name": "Buffer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Buffer = struct",
              "anchor": "buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer",
              "source_path": "src/vulkan/buffer.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L12",
              "doc": {
                "summary": "Vulkan buffer allocation paired with its device memory and optional mapped pointer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Vulkan buffer allocation paired with its device memory and optional mapped pointer."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Buffer.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( instance: *const Instance, size: vk.c.VkDeviceSize, usage: vk.c.VkBufferUsageFlags, mem_properties: vk.c.VkMemoryPropertyFlags, ) !Buffer",
                  "anchor": "buffer-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-init",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 31,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L31",
                  "doc": {
                    "summary": "Create a Vulkan buffer and allocate backing device memory for it.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "size",
                        "description": "Buffer size in bytes."
                      },
                      {
                        "name": "usage",
                        "description": "Vulkan buffer usage flags."
                      },
                      {
                        "name": "mem_properties",
                        "description": "Required Vulkan memory property flags for the allocation."
                      }
                    ],
                    "returns": "A Buffer with memory bound but not automatically mapped.",
                    "notes": [
                      "Use `initStaging()` when you need an immediately mapped upload buffer."
                    ],
                    "raw": "Create a Vulkan buffer and allocate backing device memory for it."
                  }
                },
                {
                  "name": "initDeviceLocal",
                  "qualified_name": "Buffer.initDeviceLocal",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initDeviceLocal(instance: *const Instance, size: vk.c.VkDeviceSize, usage: vk.c.VkBufferUsageFlags) !Buffer",
                  "anchor": "buffer-init-device-local",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-init-device-local",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 104,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L104",
                  "doc": {
                    "summary": "Create a device-local buffer for GPU-only reads and writes.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "size",
                        "description": "Buffer size in bytes."
                      },
                      {
                        "name": "usage",
                        "description": "Additional Vulkan usage flags for the buffer."
                      }
                    ],
                    "returns": "A device-local buffer with transfer-destination usage enabled.",
                    "notes": [
                      "This helper automatically adds `VK_BUFFER_USAGE_TRANSFER_DST_BIT` for staging uploads."
                    ],
                    "raw": "Create a device-local buffer for GPU-only reads and writes."
                  }
                },
                {
                  "name": "initStaging",
                  "qualified_name": "Buffer.initStaging",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initStaging(instance: *const Instance, size: vk.c.VkDeviceSize) !Buffer",
                  "anchor": "buffer-init-staging",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-init-staging",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 118,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L118",
                  "doc": {
                    "summary": "Create and immediately map a host-visible staging buffer.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "size",
                        "description": "Buffer size in bytes."
                      }
                    ],
                    "returns": "A staging buffer ready for CPU writes through `mapped`.",
                    "notes": [
                      "The buffer uses coherent host memory so writes do not require an explicit flush."
                    ],
                    "raw": "Create and immediately map a host-visible staging buffer."
                  }
                },
                {
                  "name": "initHostVisibleStorage",
                  "qualified_name": "Buffer.initHostVisibleStorage",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initHostVisibleStorage(instance: *const Instance, size: vk.c.VkDeviceSize) !Buffer",
                  "anchor": "buffer-init-host-visible-storage",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-init-host-visible-storage",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 147,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L147",
                  "doc": {
                    "summary": "Create a host-visible storage buffer that the GPU reads in place via PCIe.",
                    "description": [
                      "it over PCIe BAR rather than from device-local VRAM. Used to offload large rarely-touched tensors (MoE expert weights) when device memory is insufficient. Coherent memory means no explicit invalidate is needed; we only write at load time."
                    ],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "size",
                        "description": "Buffer size in bytes."
                      }
                    ],
                    "returns": "A storage buffer ready for direct CPU writes through `mapped`.",
                    "notes": [
                      "Memory is allocated as `HOST_VISIBLE | HOST_COHERENT`, so the GPU reads"
                    ],
                    "raw": "Create a host-visible storage buffer that the GPU reads in place via PCIe.\nit over PCIe BAR rather than from device-local VRAM. Used to offload large\nrarely-touched tensors (MoE expert weights) when device memory is insufficient.\nCoherent memory means no explicit invalidate is needed; we only write at load time."
                  }
                },
                {
                  "name": "upload",
                  "qualified_name": "Buffer.upload",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn upload(self: *const Buffer, data: []const u8) void",
                  "anchor": "buffer-upload",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-upload",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 171,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L171",
                  "doc": {
                    "summary": "Copy raw bytes into a previously mapped buffer (staging or host-visible storage).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Buffer whose `mapped` pointer is non-null."
                      },
                      {
                        "name": "data",
                        "description": "Bytes to copy from the CPU into the mapped range."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Asserts at debug time that the buffer is mapped and `data` fits within the allocation."
                    ],
                    "raw": "Copy raw bytes into a previously mapped buffer (staging or host-visible storage)."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Buffer.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Buffer) void",
                  "anchor": "buffer-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#buffer-deinit",
                  "source_path": "src/vulkan/buffer.zig",
                  "source_line": 179,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L179",
                  "doc": {
                    "summary": "Destroy the Vulkan buffer, free device memory, and unmap any host-mapped pointer.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Buffer to tear down; the struct fields are set to `undefined` on return."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the Vulkan buffer, free device memory, and unmap any host-mapped pointer."
                  }
                }
              ]
            },
            {
              "name": "copyBuffer",
              "qualified_name": "copyBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn copyBuffer( instance: *const Instance, cmd_pool: vk.c.VkCommandPool, src: *const Buffer, dst: *const Buffer, size: vk.c.VkDeviceSize, ) !void",
              "anchor": "copy-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#copy-buffer",
              "source_path": "src/vulkan/buffer.zig",
              "source_line": 198,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/buffer.zig#L198",
              "doc": {
                "summary": "Copy bytes between two Vulkan buffers with a temporary one-shot command buffer.",
                "description": [],
                "params": [
                  {
                    "name": "instance",
                    "description": "Active Vulkan instance and logical device."
                  },
                  {
                    "name": "cmd_pool",
                    "description": "Command pool used to allocate the temporary command buffer."
                  },
                  {
                    "name": "src",
                    "description": "Source buffer."
                  },
                  {
                    "name": "dst",
                    "description": "Destination buffer."
                  },
                  {
                    "name": "size",
                    "description": "Number of bytes to copy."
                  }
                ],
                "returns": "`error.AllocCmdBufFailed` or `error.QueueSubmitFailed` when command allocation or submission fails.",
                "notes": [
                  "This helper waits for the compute queue to go idle before returning."
                ],
                "raw": "Copy bytes between two Vulkan buffers with a temporary one-shot command buffer."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "command",
          "title": "Command",
          "section": "Vulkan Runtime",
          "summary": "Create reusable compute command pools and command buffers.",
          "overview": [
            "The decode runtime uses these wrappers to record dispatches, insert barriers, and synchronize submitted compute work."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/",
          "source_path": "src/vulkan/command.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L57",
          "counts": {
            "code_lines": 496,
            "exports": 2,
            "methods": 23,
            "symbols": 25
          },
          "symbols": [
            {
              "name": "CommandPool",
              "qualified_name": "CommandPool",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CommandPool = struct",
              "anchor": "command-pool",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-pool",
              "source_path": "src/vulkan/command.zig",
              "source_line": 57,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L57",
              "doc": {
                "summary": "Command pool for allocating command buffers.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Command pool for allocating command buffers."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "CommandPool.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(instance: *const Instance) !CommandPool",
                  "anchor": "command-pool-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-pool-init",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 66,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L66",
                  "doc": {
                    "summary": "Create a command pool bound to the selected compute queue family.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      }
                    ],
                    "returns": "A CommandPool ready to allocate compute command buffers.",
                    "notes": [],
                    "raw": "Create a command pool bound to the selected compute queue family."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "CommandPool.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *CommandPool) void",
                  "anchor": "command-pool-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-pool-deinit",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 89,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L89",
                  "doc": {
                    "summary": "Destroy the underlying Vulkan command pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command pool to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the underlying Vulkan command pool."
                  }
                }
              ]
            },
            {
              "name": "CommandBuffer",
              "qualified_name": "CommandBuffer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CommandBuffer = struct",
              "anchor": "command-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer",
              "source_path": "src/vulkan/command.zig",
              "source_line": 96,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L96",
              "doc": {
                "summary": "A recorded command buffer that can be submitted and replayed.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A recorded command buffer that can be submitted and replayed."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "CommandBuffer.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(instance: *const Instance, pool: *const CommandPool) !CommandBuffer",
                  "anchor": "command-buffer-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-init",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 110,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L110",
                  "doc": {
                    "summary": "Allocate a primary command buffer and fence from a compute command pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Active Vulkan instance and logical device."
                      },
                      {
                        "name": "pool",
                        "description": "Command pool used for command buffer allocation."
                      }
                    ],
                    "returns": "A CommandBuffer paired with a completion fence.",
                    "notes": [],
                    "raw": "Allocate a primary command buffer and fence from a compute command pool."
                  }
                },
                {
                  "name": "begin",
                  "qualified_name": "CommandBuffer.begin",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn begin(self: *CommandBuffer) !void",
                  "anchor": "command-buffer-begin",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-begin",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 150,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L150",
                  "doc": {
                    "summary": "Begin recording a reusable command buffer.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer to begin recording into."
                      }
                    ],
                    "returns": "`error.BeginCommandBufferFailed` when Vulkan rejects the begin request.",
                    "notes": [
                      "Use `reset()` or wait for prior submissions before recording into the same buffer again."
                    ],
                    "raw": "Begin recording a reusable command buffer."
                  }
                },
                {
                  "name": "beginOneTime",
                  "qualified_name": "CommandBuffer.beginOneTime",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn beginOneTime(self: *CommandBuffer) !void",
                  "anchor": "command-buffer-begin-one-time",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-begin-one-time",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 166,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L166",
                  "doc": {
                    "summary": "Begin recording for a single submit-and-discard style workload.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer to begin recording into."
                      }
                    ],
                    "returns": "`error.BeginCommandBufferFailed` when Vulkan rejects the begin request.",
                    "notes": [
                      "This sets `VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT` so the driver can optimize transient work."
                    ],
                    "raw": "Begin recording for a single submit-and-discard style workload."
                  }
                },
                {
                  "name": "dispatch",
                  "qualified_name": "CommandBuffer.dispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatch( self: *CommandBuffer, pipeline: *const Pipeline, descriptor_set: vk.c.VkDescriptorSet, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) void",
                  "anchor": "command-buffer-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-dispatch",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 186,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L186",
                  "doc": {
                    "summary": "Record a compute dispatch with an already-created descriptor set.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "pipeline",
                        "description": "Compute pipeline to bind before dispatch."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set bound at set `0`."
                      },
                      {
                        "name": "group_count_x",
                        "description": "Workgroup count in the X dimension."
                      },
                      {
                        "name": "group_count_y",
                        "description": "Workgroup count in the Y dimension."
                      },
                      {
                        "name": "group_count_z",
                        "description": "Workgroup count in the Z dimension."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "This helper binds pipeline and descriptors only; required barriers must be recorded separately."
                    ],
                    "raw": "Record a compute dispatch with an already-created descriptor set."
                  }
                },
                {
                  "name": "dispatchWithPush",
                  "qualified_name": "CommandBuffer.dispatchWithPush",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchWithPush( self: *CommandBuffer, pipeline: *const Pipeline, descriptor_set: vk.c.VkDescriptorSet, push_data: []const u8, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) void",
                  "anchor": "command-buffer-dispatch-with-push",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-dispatch-with-push",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 222,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L222",
                  "doc": {
                    "summary": "Record a compute dispatch that also uploads a serialized push-constant block.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "pipeline",
                        "description": "Compute pipeline to bind before dispatch."
                      },
                      {
                        "name": "descriptor_set",
                        "description": "Descriptor set bound at set `0`."
                      },
                      {
                        "name": "push_data",
                        "description": "Raw bytes copied into the pipeline's push-constant range at offset `0`."
                      },
                      {
                        "name": "group_count_x",
                        "description": "Workgroup count in the X dimension."
                      },
                      {
                        "name": "group_count_y",
                        "description": "Workgroup count in the Y dimension."
                      },
                      {
                        "name": "group_count_z",
                        "description": "Workgroup count in the Z dimension."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "The caller is responsible for matching `push_data` to the shader layout declared by `pipeline`."
                    ],
                    "raw": "Record a compute dispatch that also uploads a serialized push-constant block."
                  }
                },
                {
                  "name": "pushDescAndDispatch",
                  "qualified_name": "CommandBuffer.pushDescAndDispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn pushDescAndDispatch( self: *CommandBuffer, pipeline: *const Pipeline, push_desc_fn: ?PushDescriptorFn, buffer_infos: []const vk.c.VkDescriptorBufferInfo, push_data: []const u8, group_count_x: u32, group_count_y: u32, group_count_z: u32, ) void",
                  "anchor": "command-buffer-push-desc-and-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-push-desc-and-dispatch",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 268,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L268",
                  "doc": {
                    "summary": "Record a compute dispatch using `VK_KHR_push_descriptor`.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "pipeline",
                        "description": "Compute pipeline whose set-0 layout was created for push descriptors."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Loaded `vkCmdPushDescriptorSetKHR` function pointer."
                      },
                      {
                        "name": "buffer_infos",
                        "description": "Storage-buffer bindings to push into set `0`; at most 8 entries."
                      },
                      {
                        "name": "push_data",
                        "description": "Raw bytes copied into the pipeline's push-constant range at offset `0`; may be empty."
                      },
                      {
                        "name": "group_count_x",
                        "description": "Workgroup count in the X dimension."
                      },
                      {
                        "name": "group_count_y",
                        "description": "Workgroup count in the Y dimension."
                      },
                      {
                        "name": "group_count_z",
                        "description": "Workgroup count in the Z dimension."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Asserts that `push_desc_fn` is non-null and `buffer_infos.len <= 8`."
                    ],
                    "raw": "Record a compute dispatch using `VK_KHR_push_descriptor`."
                  }
                },
                {
                  "name": "pushDescAndDispatchIndirect",
                  "qualified_name": "CommandBuffer.pushDescAndDispatchIndirect",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn pushDescAndDispatchIndirect( self: *CommandBuffer, pipeline: *const Pipeline, push_desc_fn: ?PushDescriptorFn, buffer_infos: []const vk.c.VkDescriptorBufferInfo, push_data: []const u8, indirect_buffer: vk.c.VkBuffer, indirect_offset: vk.c.VkDeviceSize, ) void",
                  "anchor": "command-buffer-push-desc-and-dispatch-indirect",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-push-desc-and-dispatch-indirect",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 333,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L333",
                  "doc": {
                    "summary": "Record a push-descriptor compute dispatch whose group counts are read from a device buffer.",
                    "description": [
                      "The indirect buffer must contain a `VkDispatchIndirectCommand` at the given byte offset."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      },
                      {
                        "name": "pipeline",
                        "description": "Compute pipeline whose set-0 layout was created for push descriptors."
                      },
                      {
                        "name": "push_desc_fn",
                        "description": "Loaded `vkCmdPushDescriptorSetKHR` function pointer."
                      },
                      {
                        "name": "buffer_infos",
                        "description": "Storage-buffer bindings to push into set `0`; at most 8 entries."
                      },
                      {
                        "name": "push_data",
                        "description": "Raw bytes copied into the pipeline's push-constant range at offset `0`; may be empty."
                      },
                      {
                        "name": "indirect_buffer",
                        "description": "Device buffer containing the `VkDispatchIndirectCommand` group counts."
                      },
                      {
                        "name": "indirect_offset",
                        "description": "Byte offset into `indirect_buffer` where the command struct begins."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Asserts that `push_desc_fn` is non-null and `buffer_infos.len <= 8`."
                    ],
                    "raw": "Record a push-descriptor compute dispatch whose group counts are read from a device buffer.\nThe indirect buffer must contain a `VkDispatchIndirectCommand` at the given byte offset."
                  }
                },
                {
                  "name": "computeBufferBarrier",
                  "qualified_name": "CommandBuffer.computeBufferBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeBufferBarrier(self: *const CommandBuffer, buffer: vk.c.VkBuffer, size: vk.c.VkDeviceSize) void",
                  "anchor": "command-buffer-compute-buffer-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-buffer-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 410,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L410",
                  "doc": {
                    "summary": "Insert a buffer-specific compute barrier (only synchronizes the given buffer).",
                    "description": [
                      "May allow the driver to avoid flushing unrelated caches."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a buffer-specific compute barrier (only synchronizes the given buffer).\nMay allow the driver to avoid flushing unrelated caches."
                  }
                },
                {
                  "name": "computeToIndirectBufferBarrier",
                  "qualified_name": "CommandBuffer.computeToIndirectBufferBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeToIndirectBufferBarrier(self: *const CommandBuffer, buffer: vk.c.VkBuffer, size: vk.c.VkDeviceSize) void",
                  "anchor": "command-buffer-compute-to-indirect-buffer-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-to-indirect-buffer-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 439,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L439",
                  "doc": {
                    "summary": "Insert a compute-shader-write to indirect-command-read barrier.",
                    "description": [
                      "Needed when a shader writes VkDispatchIndirectCommand records consumed by vkCmdDispatchIndirect later in the same command buffer."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a compute-shader-write to indirect-command-read barrier.\nNeeded when a shader writes VkDispatchIndirectCommand records consumed\nby vkCmdDispatchIndirect later in the same command buffer."
                  }
                },
                {
                  "name": "computeBuffersBarrier",
                  "qualified_name": "CommandBuffer.computeBuffersBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeBuffersBarrier(self: *const CommandBuffer, ranges: []const BufferRange) void",
                  "anchor": "command-buffer-compute-buffers-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-buffers-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 476,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L476",
                  "doc": {
                    "summary": "Insert a multi-buffer compute barrier covering several specific buffer ranges in one vkCmdPipelineBarrier call.",
                    "description": [
                      "Lets the driver flush only the named buffer caches instead of a global memory barrier — when downstream ops only depend on a known subset of pending writes, unrelated in-flight writes can keep flowing. Up to 8 ranges supported in the inline buffer; larger calls fall back to global."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a multi-buffer compute barrier covering several specific buffer ranges\nin one vkCmdPipelineBarrier call. Lets the driver flush only the named buffer\ncaches instead of a global memory barrier — when downstream ops only depend on\na known subset of pending writes, unrelated in-flight writes can keep flowing.\nUp to 8 ranges supported in the inline buffer; larger calls fall back to global."
                  }
                },
                {
                  "name": "computeBarrier",
                  "qualified_name": "CommandBuffer.computeBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeBarrier(self: *const CommandBuffer) void",
                  "anchor": "command-buffer-compute-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 517,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L517",
                  "doc": {
                    "summary": "Insert a compute-to-compute pipeline barrier (shader write → shader read).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Uses a coarse global memory barrier; prefer buffer barriers for fine-grained sync."
                    ],
                    "raw": "Insert a compute-to-compute pipeline barrier (shader write → shader read)."
                  }
                },
                {
                  "name": "computeToTransferBarrier",
                  "qualified_name": "CommandBuffer.computeToTransferBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeToTransferBarrier(self: *const CommandBuffer) void",
                  "anchor": "command-buffer-compute-to-transfer-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-to-transfer-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 524,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L524",
                  "doc": {
                    "summary": "Insert a compute-to-transfer pipeline barrier (shader write → transfer read/write).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Use this before copying from or into buffers produced by compute shaders."
                    ],
                    "raw": "Insert a compute-to-transfer pipeline barrier (shader write → transfer read/write)."
                  }
                },
                {
                  "name": "transferToComputeBarrier",
                  "qualified_name": "CommandBuffer.transferToComputeBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn transferToComputeBarrier(self: *const CommandBuffer) void",
                  "anchor": "command-buffer-transfer-to-compute-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-transfer-to-compute-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 531,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L531",
                  "doc": {
                    "summary": "Insert a transfer-to-compute pipeline barrier (copy/upload → shader read).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Ensures prior transfer writes are visible before subsequent compute dispatches."
                    ],
                    "raw": "Insert a transfer-to-compute pipeline barrier (copy/upload → shader read)."
                  }
                },
                {
                  "name": "computeAndTransferBarrier",
                  "qualified_name": "CommandBuffer.computeAndTransferBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeAndTransferBarrier(self: *const CommandBuffer) void",
                  "anchor": "command-buffer-compute-and-transfer-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-compute-and-transfer-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 538,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L538",
                  "doc": {
                    "summary": "Insert a combined compute→compute+transfer barrier.",
                    "description": [
                      "Shader writes become visible to both subsequent compute dispatches and transfer reads. Use when compute output feeds both a shader read and a buffer copy in the same stage."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a combined compute→compute+transfer barrier.\nShader writes become visible to both subsequent compute dispatches and transfer reads.\nUse when compute output feeds both a shader read and a buffer copy in the same stage."
                  }
                },
                {
                  "name": "transferToTransferBarrier",
                  "qualified_name": "CommandBuffer.transferToTransferBarrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn transferToTransferBarrier(self: *const CommandBuffer) void",
                  "anchor": "command-buffer-transfer-to-transfer-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-transfer-to-transfer-barrier",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 549,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L549",
                  "doc": {
                    "summary": "Insert a transfer→transfer pipeline barrier (copy write → copy read).",
                    "description": [
                      "by another vkCmdCopyBuffer in the same or a subsequent command buffer, and the caller wants strict-spec memory visibility without relying on implicit same-queue ordering semantics. This is the cross-CB safety net for effort-6 cycle 7's layer-0 stash buffers."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer currently being recorded."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Needed when a vkCmdCopyBuffer writes a buffer whose contents are read"
                    ],
                    "raw": "Insert a transfer→transfer pipeline barrier (copy write → copy read).\nby another vkCmdCopyBuffer in the same or a subsequent command buffer, and\nthe caller wants strict-spec memory visibility without relying on implicit\nsame-queue ordering semantics. This is the cross-CB safety net for\neffort-6 cycle 7's layer-0 stash buffers."
                  }
                },
                {
                  "name": "end",
                  "qualified_name": "CommandBuffer.end",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn end(self: *const CommandBuffer) !void",
                  "anchor": "command-buffer-end",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-end",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 561,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L561",
                  "doc": {
                    "summary": "Finalize command recording so the buffer can be submitted.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer to finalize."
                      }
                    ],
                    "returns": "`error.EndCommandBufferFailed` when Vulkan rejects the recorded command stream.",
                    "notes": [],
                    "raw": "Finalize command recording so the buffer can be submitted."
                  }
                },
                {
                  "name": "submitAndWait",
                  "qualified_name": "CommandBuffer.submitAndWait",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn submitAndWait(self: *const CommandBuffer, queue: vk.c.VkQueue) !void",
                  "anchor": "command-buffer-submit-and-wait",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-submit-and-wait",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 571,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L571",
                  "doc": {
                    "summary": "Submit the command buffer and block until the GPU signals completion.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Recorded command buffer to submit."
                      },
                      {
                        "name": "queue",
                        "description": "Queue to submit the work on."
                      }
                    ],
                    "returns": "`error.QueueSubmitFailed` or `error.FenceWaitFailed` when submission or synchronization fails.",
                    "notes": [
                      "The fence is reset before returning so the command buffer can be reused by a later step."
                    ],
                    "raw": "Submit the command buffer and block until the GPU signals completion."
                  }
                },
                {
                  "name": "submit",
                  "qualified_name": "CommandBuffer.submit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn submit(self: *const CommandBuffer, queue: vk.c.VkQueue) !void",
                  "anchor": "command-buffer-submit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-submit",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 601,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L601",
                  "doc": {
                    "summary": "Submit recorded work and return immediately.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Recorded command buffer to submit."
                      },
                      {
                        "name": "queue",
                        "description": "Queue to submit the work on."
                      }
                    ],
                    "returns": "`error.QueueSubmitFailed` when Vulkan rejects the submission.",
                    "notes": [
                      "Pair this with `waitForCompletion()` before resetting or re-recording the command buffer."
                    ],
                    "raw": "Submit recorded work and return immediately."
                  }
                },
                {
                  "name": "waitForCompletion",
                  "qualified_name": "CommandBuffer.waitForCompletion",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn waitForCompletion(self: *const CommandBuffer) !void",
                  "anchor": "command-buffer-wait-for-completion",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-wait-for-completion",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 625,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L625",
                  "doc": {
                    "summary": "Wait for the command buffer's fence to signal and then reset it.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer whose most recent submission should complete before returning."
                      }
                    ],
                    "returns": "`error.FenceWaitFailed` when the wait operation fails.",
                    "notes": [
                      "After this returns, the command buffer can be reset and recorded again."
                    ],
                    "raw": "Wait for the command buffer's fence to signal and then reset it."
                  }
                },
                {
                  "name": "reset",
                  "qualified_name": "CommandBuffer.reset",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn reset(self: *const CommandBuffer) !void",
                  "anchor": "command-buffer-reset",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-reset",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 635,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L635",
                  "doc": {
                    "summary": "Reset the command buffer so new commands can be recorded into it.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer to reset."
                      }
                    ],
                    "returns": "`error.ResetCommandBufferFailed` when Vulkan rejects the reset request.",
                    "notes": [
                      "The caller must ensure the previous submission has completed before calling this."
                    ],
                    "raw": "Reset the command buffer so new commands can be recorded into it."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "CommandBuffer.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *CommandBuffer, pool: *const CommandPool) void",
                  "anchor": "command-buffer-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-buffer-deinit",
                  "source_path": "src/vulkan/command.zig",
                  "source_line": 644,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/command.zig#L644",
                  "doc": {
                    "summary": "Destroy the command buffer fence and free the command buffer back to its pool.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Command buffer to tear down in place."
                      },
                      {
                        "name": "pool",
                        "description": "Command pool that owns the Vulkan command buffer allocation."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Callers should ensure the GPU is no longer using the buffer before teardown."
                    ],
                    "raw": "Destroy the command buffer fence and free the command buffer back to its pool."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "instance",
          "title": "Instance",
          "section": "Vulkan Runtime",
          "summary": "Initialize Vulkan, select a compute-capable device, and expose memory utilities.",
          "overview": [
            "This is the entry point for GPU setup: instance creation, device selection, queue discovery, and VRAM inspection."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/",
          "source_path": "src/vulkan/instance.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L12",
          "counts": {
            "code_lines": 428,
            "exports": 5,
            "methods": 5,
            "symbols": 10
          },
          "symbols": [
            {
              "name": "auto_select_device_index",
              "qualified_name": "auto_select_device_index",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const auto_select_device_index: u32 = std.math.maxInt(u32)",
              "anchor": "auto-select-device-index",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#auto-select-device-index",
              "source_path": "src/vulkan/instance.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L12",
              "doc": {
                "summary": "Sentinel passed by callers that want ZINC to choose the best Vulkan device.",
                "description": [
                  "Explicit CLI `-d/--device` values are still honored exactly."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Sentinel passed by callers that want ZINC to choose the best Vulkan device.\nExplicit CLI `-d/--device` values are still honored exactly."
              },
              "members": []
            },
            {
              "name": "PushDescriptorFn",
              "qualified_name": "PushDescriptorFn",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const PushDescriptorFn = *const fn ( vk.c.VkCommandBuffer, vk.c.VkPipelineBindPoint, vk.c.VkPipelineLayout, u32, u32, [*]const vk.c.VkWriteDescriptorSet, ) callconv(.c) void",
              "anchor": "push-descriptor-fn",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#push-descriptor-fn",
              "source_path": "src/vulkan/instance.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L15",
              "doc": {
                "summary": "Function pointer type for `vkCmdPushDescriptorSetKHR` when the extension is enabled.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Function pointer type for `vkCmdPushDescriptorSetKHR` when the extension is enabled."
              },
              "members": []
            },
            {
              "name": "DeviceCapabilities",
              "qualified_name": "DeviceCapabilities",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DeviceCapabilities = struct",
              "anchor": "device-capabilities",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#device-capabilities",
              "source_path": "src/vulkan/instance.zig",
              "source_line": 25,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L25",
              "doc": {
                "summary": "Queried Vulkan device capabilities that affect pipeline creation choices.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Queried Vulkan device capabilities that affect pipeline creation choices."
              },
              "members": [
                {
                  "name": "supportsRequiredSubgroupSize",
                  "qualified_name": "DeviceCapabilities.supportsRequiredSubgroupSize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn supportsRequiredSubgroupSize(self: DeviceCapabilities, size: u32) bool",
                  "anchor": "device-capabilities-supports-required-subgroup-size",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#device-capabilities-supports-required-subgroup-size",
                  "source_path": "src/vulkan/instance.zig",
                  "source_line": 54,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L54",
                  "doc": {
                    "summary": "Return whether a compute shader can request the given subgroup size at pipeline creation.",
                    "description": [],
                    "params": [
                      {
                        "name": "size",
                        "description": "Desired subgroup width to validate against the device's min/max range."
                      }
                    ],
                    "returns": "`true` when subgroup size control is enabled, `size` is within the supported range, and the compute stage supports `requiredSubgroupSize`.",
                    "notes": [],
                    "raw": "Return whether a compute shader can request the given subgroup size at pipeline creation."
                  }
                }
              ]
            },
            {
              "name": "selectPhysicalDeviceIndex",
              "qualified_name": "selectPhysicalDeviceIndex",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn selectPhysicalDeviceIndex( allocator: std.mem.Allocator, phys_devices: []const vk.c.VkPhysicalDevice, dev_count: u32, preferred_device: u32, ) !u32",
              "anchor": "select-physical-device-index",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#select-physical-device-index",
              "source_path": "src/vulkan/instance.zig",
              "source_line": 101,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L101",
              "doc": {
                "summary": "Resolve a Vulkan physical-device index.",
                "description": [
                  "Explicit device indices are honored exactly. The auto path avoids the common mixed-AMD trap where Mesa enumerates an APU/iGPU as device 0 and the discrete RDNA card as device 1."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Resolve a Vulkan physical-device index.\n\nExplicit device indices are honored exactly. The auto path avoids the common\nmixed-AMD trap where Mesa enumerates an APU/iGPU as device 0 and the discrete\nRDNA card as device 1."
              },
              "members": []
            },
            {
              "name": "Instance",
              "qualified_name": "Instance",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Instance = struct",
              "anchor": "instance",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#instance",
              "source_path": "src/vulkan/instance.zig",
              "source_line": 140,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L140",
              "doc": {
                "summary": "Active Vulkan instance, selected physical device, logical device, and memory metadata.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Active Vulkan instance, selected physical device, logical device, and memory metadata."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Instance.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, preferred_device: u32) !Instance",
                  "anchor": "instance-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#instance-init",
                  "source_path": "src/vulkan/instance.zig",
                  "source_line": 168,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L168",
                  "doc": {
                    "summary": "Create a Vulkan instance and select a compute-capable device.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator used for device and queue enumeration and stored for the lifetime of the instance."
                      },
                      {
                        "name": "preferred_device",
                        "description": "Preferred physical device index when multiple GPUs are present."
                      }
                    ],
                    "returns": "An initialized Instance bound to a logical device and compute queue.",
                    "notes": [],
                    "raw": "Create a Vulkan instance and select a compute-capable device."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Instance.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Instance) void",
                  "anchor": "instance-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#instance-deinit",
                  "source_path": "src/vulkan/instance.zig",
                  "source_line": 397,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L397",
                  "doc": {
                    "summary": "Wait for outstanding work, destroy the logical device, and destroy the Vulkan instance.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Vulkan instance wrapper to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Wait for outstanding work, destroy the logical device, and destroy the Vulkan instance."
                  }
                },
                {
                  "name": "findMemoryType",
                  "qualified_name": "Instance.findMemoryType",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn findMemoryType(self: *const Instance, type_filter: u32, properties: vk.c.VkMemoryPropertyFlags) ?u32",
                  "anchor": "instance-find-memory-type",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#instance-find-memory-type",
                  "source_path": "src/vulkan/instance.zig",
                  "source_line": 410,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L410",
                  "doc": {
                    "summary": "Find a Vulkan memory type that satisfies both compatibility and property requirements.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active Vulkan instance and memory properties."
                      },
                      {
                        "name": "type_filter",
                        "description": "Bitmask of compatible memory types reported by Vulkan."
                      },
                      {
                        "name": "properties",
                        "description": "Required Vulkan memory property flags."
                      }
                    ],
                    "returns": "The matching memory type index, or `null` when no memory type satisfies the request.",
                    "notes": [
                      "All requested property bits must be present on the returned memory type."
                    ],
                    "raw": "Find a Vulkan memory type that satisfies both compatibility and property requirements."
                  }
                },
                {
                  "name": "vramBytes",
                  "qualified_name": "Instance.vramBytes",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn vramBytes(self: *const Instance) u64",
                  "anchor": "instance-vram-bytes",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/instance/#instance-vram-bytes",
                  "source_path": "src/vulkan/instance.zig",
                  "source_line": 426,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/instance.zig#L426",
                  "doc": {
                    "summary": "Sum the size of all device-local memory heaps exposed by the selected GPU.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active Vulkan instance and memory properties."
                      }
                    ],
                    "returns": "The total number of bytes in device-local heaps.",
                    "notes": [
                      "Drivers may expose multiple heaps, so this is an aggregate capacity rather than a single contiguous pool."
                    ],
                    "raw": "Sum the size of all device-local memory heaps exposed by the selected GPU."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "pipeline",
          "title": "Pipeline",
          "section": "Vulkan Runtime",
          "summary": "Load SPIR-V compute shaders into Vulkan pipelines.",
          "overview": [
            "Dispatch helpers use this module to build descriptor layouts, pipeline layouts, and compute pipelines from the compiled shader binaries."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/",
          "source_path": "src/vulkan/pipeline.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L12",
          "counts": {
            "code_lines": 201,
            "exports": 5,
            "methods": 1,
            "symbols": 6
          },
          "symbols": [
            {
              "name": "Pipeline",
              "qualified_name": "Pipeline",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Pipeline = struct",
              "anchor": "pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#pipeline",
              "source_path": "src/vulkan/pipeline.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L12",
              "doc": {
                "summary": "A compute pipeline wrapping a SPIR-V shader module.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A compute pipeline wrapping a SPIR-V shader module."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "Pipeline.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Pipeline) void",
                  "anchor": "pipeline-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#pipeline-deinit",
                  "source_path": "src/vulkan/pipeline.zig",
                  "source_line": 28,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L28",
                  "doc": {
                    "summary": "Destroy the shader module, descriptor layout, pipeline layout, and pipeline.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Pipeline object to tear down in place."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the shader module, descriptor layout, pipeline layout, and pipeline."
                  }
                }
              ]
            },
            {
              "name": "SpecConst",
              "qualified_name": "SpecConst",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const SpecConst = struct",
              "anchor": "spec-const",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#spec-const",
              "source_path": "src/vulkan/pipeline.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L38",
              "doc": {
                "summary": "Specialization constant entry for compute pipelines.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Specialization constant entry for compute pipelines."
              },
              "members": []
            },
            {
              "name": "PipelineOptions",
              "qualified_name": "PipelineOptions",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const PipelineOptions = struct",
              "anchor": "pipeline-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#pipeline-options",
              "source_path": "src/vulkan/pipeline.zig",
              "source_line": 46,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L46",
              "doc": {
                "summary": "Optional compute-pipeline knobs for subgroup-sensitive shaders.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Optional compute-pipeline knobs for subgroup-sensitive shaders."
              },
              "members": []
            },
            {
              "name": "createFromSpirv",
              "qualified_name": "createFromSpirv",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createFromSpirv( instance: *const Instance, spirv_path: []const u8, binding_count: u32, push_constant_size: u32, spec_constants: []const SpecConst, allocator: std.mem.Allocator, ) !Pipeline",
              "anchor": "create-from-spirv",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-from-spirv",
              "source_path": "src/vulkan/pipeline.zig",
              "source_line": 63,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L63",
              "doc": {
                "summary": "Create a compute pipeline from a SPIR-V file.",
                "description": [],
                "params": [
                  {
                    "name": "instance",
                    "description": "Active Vulkan instance and logical device."
                  },
                  {
                    "name": "spirv_path",
                    "description": "Filesystem path to the compiled SPIR-V module."
                  },
                  {
                    "name": "binding_count",
                    "description": "Number of storage-buffer bindings expected by the shader."
                  },
                  {
                    "name": "push_constant_size",
                    "description": "Size of the push-constant block in bytes."
                  },
                  {
                    "name": "spec_constants",
                    "description": "Specialization constants applied at pipeline creation time."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for shader bytes and temporary Vulkan structs."
                  }
                ],
                "returns": "A fully created compute pipeline and its associated layouts.",
                "notes": [],
                "raw": "Create a compute pipeline from a SPIR-V file."
              },
              "members": []
            },
            {
              "name": "createFromSpirvWithOptions",
              "qualified_name": "createFromSpirvWithOptions",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createFromSpirvWithOptions( instance: *const Instance, spirv_path: []const u8, binding_count: u32, push_constant_size: u32, spec_constants: []const SpecConst, options: PipelineOptions, allocator: std.mem.Allocator, ) !Pipeline",
              "anchor": "create-from-spirv-with-options",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-from-spirv-with-options",
              "source_path": "src/vulkan/pipeline.zig",
              "source_line": 95,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/pipeline.zig#L95",
              "doc": {
                "summary": "Create a compute pipeline from a SPIR-V file with optional subgroup and push-descriptor controls.",
                "description": [
                  "Reads the SPIR-V binary from disk, creates a shader module, builds a descriptor set layout (optionally flagged for push-descriptor recording), a pipeline layout with push constants, and a compute pipeline with specialization constants applied. Subgroup-size and full-subgroup requirements are silently dropped when the device does not support them."
                ],
                "params": [
                  {
                    "name": "instance",
                    "description": "Active Vulkan instance providing the logical device and capability info."
                  },
                  {
                    "name": "spirv_path",
                    "description": "Filesystem path to the compiled SPIR-V module."
                  },
                  {
                    "name": "binding_count",
                    "description": "Number of storage-buffer descriptor bindings declared by the shader."
                  },
                  {
                    "name": "push_constant_size",
                    "description": "Size of the push-constant block in bytes; pass 0 for none."
                  },
                  {
                    "name": "spec_constants",
                    "description": "Specialization constants applied at pipeline creation time."
                  },
                  {
                    "name": "options",
                    "description": "Optional subgroup and push-descriptor knobs; use `.{}` for defaults."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator used for shader bytes and temporary Vulkan structs; freed before return."
                  }
                ],
                "returns": "A fully created `Pipeline` with all Vulkan objects owned by the caller.",
                "notes": [],
                "raw": "Create a compute pipeline from a SPIR-V file with optional subgroup and push-descriptor controls.\nReads the SPIR-V binary from disk, creates a shader module, builds a descriptor set layout\n(optionally flagged for push-descriptor recording), a pipeline layout with push constants,\nand a compute pipeline with specialization constants applied. Subgroup-size and\nfull-subgroup requirements are silently dropped when the device does not support them."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "tooling",
          "title": "Tooling",
          "section": "Vulkan Runtime",
          "summary": "Standalone Vulkan validation-tool imports.",
          "overview": [
            "This module is intentionally small: tools under `tools/` use it as an umbrella module when they need to exercise shader pipelines outside the main ZINC binary."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/",
          "source_path": "src/vulkan/tooling.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L7",
          "counts": {
            "code_lines": 6,
            "exports": 6,
            "methods": 0,
            "symbols": 6
          },
          "symbols": [
            {
              "name": "vk",
              "qualified_name": "vk",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const vk = @import(\"vk.zig\")",
              "anchor": "vk",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#vk",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 7,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L7",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            },
            {
              "name": "instance",
              "qualified_name": "instance",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const instance = @import(\"instance.zig\")",
              "anchor": "instance",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#instance",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 8,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L8",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            },
            {
              "name": "Instance",
              "qualified_name": "Instance",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Instance = instance.Instance",
              "anchor": "instance",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#instance",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 9,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L9",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            },
            {
              "name": "Buffer",
              "qualified_name": "Buffer",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Buffer = @import(\"buffer.zig\").Buffer",
              "anchor": "buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#buffer",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L10",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            },
            {
              "name": "command",
              "qualified_name": "command",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const command = @import(\"command.zig\")",
              "anchor": "command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#command",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L11",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            },
            {
              "name": "pipeline",
              "qualified_name": "pipeline",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const pipeline = @import(\"pipeline.zig\")",
              "anchor": "pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tooling/#pipeline",
              "source_path": "src/vulkan/tooling.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/vulkan/tooling.zig#L12",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "metal-runtime",
      "title": "Metal Runtime",
      "description": "Low-level Metal device discovery, buffers, pipelines, and command submission primitives used by the Apple Silicon backend.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#metal-runtime",
      "module_count": 6,
      "symbol_count": 51,
      "modules": [
        {
          "slug": "buffer",
          "title": "Buffer",
          "section": "Metal Runtime",
          "summary": "Metal buffer wrapper — shared-mode GPU buffers with zero-copy mmap support.",
          "overview": [
            "The Metal backend allocates shared-storage buffers so CPU code, the model loader, and GPU kernels can all see the same memory without an explicit staging copy. This module owns that wrapper and its mmap integration."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/",
          "source_path": "src/metal/buffer.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L11",
          "counts": {
            "code_lines": 160,
            "exports": 6,
            "methods": 2,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "MetalBuffer",
              "qualified_name": "MetalBuffer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MetalBuffer = struct",
              "anchor": "metal-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#metal-buffer",
              "source_path": "src/metal/buffer.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L11",
              "doc": {
                "summary": "Metal buffer handle plus CPU visibility metadata used throughout the backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Metal buffer handle plus CPU visibility metadata used throughout the backend."
              },
              "members": [
                {
                  "name": "contents",
                  "qualified_name": "MetalBuffer.contents",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn contents(self: *const MetalBuffer) ?[*]u8",
                  "anchor": "metal-buffer-contents",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#metal-buffer-contents",
                  "source_path": "src/metal/buffer.zig",
                  "source_line": 24,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L24",
                  "doc": {
                    "summary": "Return the raw CPU-visible pointer for shared-mode buffers.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the raw CPU-visible pointer for shared-mode buffers."
                  }
                },
                {
                  "name": "mapped",
                  "qualified_name": "MetalBuffer.mapped",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn mapped(self: *const MetalBuffer) ?[*]u8",
                  "anchor": "metal-buffer-mapped",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#metal-buffer-mapped",
                  "source_path": "src/metal/buffer.zig",
                  "source_line": 29,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L29",
                  "doc": {
                    "summary": "Mapped pointer alias kept for compatibility with the Vulkan buffer interface pattern.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Mapped pointer alias kept for compatibility with the Vulkan buffer interface pattern."
                  }
                }
              ]
            },
            {
              "name": "createBuffer",
              "qualified_name": "createBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createBuffer(ctx: ?*shim.MetalCtx, size: usize) !MetalBuffer",
              "anchor": "create-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#create-buffer",
              "source_path": "src/metal/buffer.zig",
              "source_line": 35,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L35",
              "doc": {
                "summary": "Allocate a shared-storage Metal buffer that is visible to both CPU and GPU code.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate a shared-storage Metal buffer that is visible to both CPU and GPU code."
              },
              "members": []
            },
            {
              "name": "createPrivateBuffer",
              "qualified_name": "createPrivateBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createPrivateBuffer(ctx: ?*shim.MetalCtx, size: usize) !MetalBuffer",
              "anchor": "create-private-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#create-private-buffer",
              "source_path": "src/metal/buffer.zig",
              "source_line": 48,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L48",
              "doc": {
                "summary": "Allocate a GPU-private Metal buffer without a CPU mapping.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate a GPU-private Metal buffer without a CPU mapping."
              },
              "members": []
            },
            {
              "name": "wrapMmap",
              "qualified_name": "wrapMmap",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn wrapMmap(ctx: ?*shim.MetalCtx, ptr: [*]u8, size: usize) !MetalBuffer",
              "anchor": "wrap-mmap",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#wrap-mmap",
              "source_path": "src/metal/buffer.zig",
              "source_line": 60,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L60",
              "doc": {
                "summary": "Wrap an existing mmap region as a Metal buffer without copying its contents.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Wrap an existing mmap region as a Metal buffer without copying its contents."
              },
              "members": []
            },
            {
              "name": "aliasBuffer",
              "qualified_name": "aliasBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn aliasBuffer(base: *const MetalBuffer, offset: usize, size: usize) MetalBuffer",
              "anchor": "alias-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#alias-buffer",
              "source_path": "src/metal/buffer.zig",
              "source_line": 73,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L73",
              "doc": {
                "summary": "Create a lightweight view into an existing buffer.",
                "description": [
                  "The returned handle is not retained and must not be freed independently of the owner."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Create a lightweight view into an existing buffer. The returned handle is\nnot retained and must not be freed independently of the owner."
              },
              "members": []
            },
            {
              "name": "freeBuffer",
              "qualified_name": "freeBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freeBuffer(buf: *MetalBuffer) void",
              "anchor": "free-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#free-buffer",
              "source_path": "src/metal/buffer.zig",
              "source_line": 85,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/buffer.zig#L85",
              "doc": {
                "summary": "Free a Metal buffer handle and clear it from the wrapper.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Free a Metal buffer handle and clear it from the wrapper."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "c",
          "title": "C",
          "section": "Metal Runtime",
          "summary": "Shared C import for the Metal shim — all Metal modules import from here to ensure type identity across compilation units.",
          "overview": [
            "Keeping the `@cImport` in one place avoids duplicate opaque C types across Zig compilation units, which is critical for safely passing shim handles between the Metal device, buffer, pipeline, and command helpers."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/c/",
          "source_path": "src/metal/c.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/c.zig#L9",
          "counts": {
            "code_lines": 1,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "shim",
              "qualified_name": "shim",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const shim = @cImport(@cInclude(\"shim.h\"))",
              "anchor": "shim",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/c/#shim",
              "source_path": "src/metal/c.zig",
              "source_line": 9,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/c.zig#L9",
              "doc": {
                "summary": "Raw Metal shim C bindings imported from the Objective-C bridge header.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Raw Metal shim C bindings imported from the Objective-C bridge header."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "command",
          "title": "Command",
          "section": "Metal Runtime",
          "summary": "Metal command buffer wrapper — dispatch recording and GPU synchronization.",
          "overview": [
            "This module is the low-level bridge between ZINC's compute dispatchers and the Objective-C Metal shim. It records compute work, barriers, and timing mode so higher-level inference code can stay backend-agnostic."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/",
          "source_path": "src/metal/command.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L32",
          "counts": {
            "code_lines": 410,
            "exports": 4,
            "methods": 14,
            "symbols": 18
          },
          "symbols": [
            {
              "name": "CommandEncoderMode",
              "qualified_name": "CommandEncoderMode",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const CommandEncoderMode = enum(u8)",
              "anchor": "command-encoder-mode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#command-encoder-mode",
              "source_path": "src/metal/command.zig",
              "source_line": 32,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L32",
              "doc": {
                "summary": "Encoder policy used when opening a Metal compute command buffer.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Encoder policy used when opening a Metal compute command buffer."
              },
              "members": []
            },
            {
              "name": "MetalCommand",
              "qualified_name": "MetalCommand",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MetalCommand = struct",
              "anchor": "metal-command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command",
              "source_path": "src/metal/command.zig",
              "source_line": 38,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L38",
              "doc": {
                "summary": "A recorded command buffer that encodes compute dispatches for the GPU.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A recorded command buffer that encodes compute dispatches for the GPU."
              },
              "members": [
                {
                  "name": "setTimingLabel",
                  "qualified_name": "MetalCommand.setTimingLabel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setTimingLabel(self: *MetalCommand, label: []const u8) void",
                  "anchor": "metal-command-set-timing-label",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-set-timing-label",
                  "source_path": "src/metal/command.zig",
                  "source_line": 52,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L52",
                  "doc": {
                    "summary": "Attach a one-dispatch timing label consumed by `ZINC_METAL_KERNEL_TIMING`.",
                    "description": [
                      "The timing aggregator copies the bytes before this label can go stale."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Attach a one-dispatch timing label consumed by `ZINC_METAL_KERNEL_TIMING`.\nThe timing aggregator copies the bytes before this label can go stale."
                  }
                },
                {
                  "name": "clearTimingLabel",
                  "qualified_name": "MetalCommand.clearTimingLabel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn clearTimingLabel(self: *MetalCommand) void",
                  "anchor": "metal-command-clear-timing-label",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-clear-timing-label",
                  "source_path": "src/metal/command.zig",
                  "source_line": 56,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L56",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "dispatch",
                  "qualified_name": "MetalCommand.dispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatch( self: *MetalCommand, pipe: *const MetalPipeline, grid: [3]u32, block: [3]u32, bufs: []const *const MetalBuffer, push_data: ?*const anyopaque, push_size: usize, ) void",
                  "anchor": "metal-command-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-dispatch",
                  "source_path": "src/metal/command.zig",
                  "source_line": 61,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L61",
                  "doc": {
                    "summary": "Encode a compute dispatch binding buffers, push constants, grid, and block sizes.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Encode a compute dispatch binding buffers, push constants, grid, and block sizes."
                  }
                },
                {
                  "name": "dispatchV2",
                  "qualified_name": "MetalCommand.dispatchV2",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchV2( self: *MetalCommand, pipe: *const MetalPipeline, grid: [3]u32, block: [3]u32, bufs: []const *const MetalBuffer, push_data: ?*const anyopaque, push_size: usize, push_idx: u32, ) void",
                  "anchor": "metal-command-dispatch-v2",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-dispatch-v2",
                  "source_path": "src/metal/command.zig",
                  "source_line": 98,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L98",
                  "doc": {
                    "summary": "Dispatch with explicit push constant buffer index.",
                    "description": [
                      "SPIRV-Cross compiled shaders place push constants at a specific buffer index (often 0 or 1). Data buffers in `bufs` are bound at all other indices in order, skipping push_idx."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch with explicit push constant buffer index.\nSPIRV-Cross compiled shaders place push constants at a specific buffer index\n(often 0 or 1). Data buffers in `bufs` are bound at all other indices in order,\nskipping push_idx."
                  }
                },
                {
                  "name": "dispatchV2WithTgMem",
                  "qualified_name": "MetalCommand.dispatchV2WithTgMem",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatchV2WithTgMem( self: *MetalCommand, pipe: *const MetalPipeline, grid: [3]u32, block: [3]u32, bufs: []const *const MetalBuffer, push_data: ?*const anyopaque, push_size: usize, push_idx: u32, tg_mem_size: u32, ) void",
                  "anchor": "metal-command-dispatch-v2-with-tg-mem",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-dispatch-v2-with-tg-mem",
                  "source_path": "src/metal/command.zig",
                  "source_line": 133,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L133",
                  "doc": {
                    "summary": "Dispatch with explicit threadgroup memory allocation.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Dispatch with explicit threadgroup memory allocation."
                  }
                },
                {
                  "name": "barrier",
                  "qualified_name": "MetalCommand.barrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn barrier(self: *MetalCommand) void",
                  "anchor": "metal-command-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-barrier",
                  "source_path": "src/metal/command.zig",
                  "source_line": 170,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L170",
                  "doc": {
                    "summary": "Insert a memory barrier ensuring all prior dispatches complete before subsequent ones.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a memory barrier ensuring all prior dispatches complete before subsequent ones."
                  }
                },
                {
                  "name": "barrierBuffers",
                  "qualified_name": "MetalCommand.barrierBuffers",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn barrierBuffers(self: *MetalCommand, bufs: []const *const MetalBuffer) void",
                  "anchor": "metal-command-barrier-buffers",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-barrier-buffers",
                  "source_path": "src/metal/command.zig",
                  "source_line": 183,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L183",
                  "doc": {
                    "summary": "Insert a resource-scoped memory barrier for the listed buffers.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a resource-scoped memory barrier for the listed buffers."
                  }
                },
                {
                  "name": "barrierResourceBuffers",
                  "qualified_name": "MetalCommand.barrierResourceBuffers",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn barrierResourceBuffers(self: *MetalCommand, bufs: []const *const MetalBuffer) void",
                  "anchor": "metal-command-barrier-resource-buffers",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-barrier-resource-buffers",
                  "source_path": "src/metal/command.zig",
                  "source_line": 229,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L229",
                  "doc": {
                    "summary": "Insert a true resource-scoped barrier.",
                    "description": [
                      "Use only when later work depends on the listed buffers and independent prior dispatches should stay free to overlap on a concurrent encoder."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Insert a true resource-scoped barrier. Use only when later work depends\non the listed buffers and independent prior dispatches should stay free\nto overlap on a concurrent encoder."
                  }
                },
                {
                  "name": "commitAndWait",
                  "qualified_name": "MetalCommand.commitAndWait",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn commitAndWait(self: *MetalCommand) void",
                  "anchor": "metal-command-commit-and-wait",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-commit-and-wait",
                  "source_path": "src/metal/command.zig",
                  "source_line": 265,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L265",
                  "doc": {
                    "summary": "Commit the command buffer to the GPU and block until execution completes.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Commit the command buffer to the GPU and block until execution completes."
                  }
                },
                {
                  "name": "commitAsync",
                  "qualified_name": "MetalCommand.commitAsync",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn commitAsync(self: *MetalCommand) void",
                  "anchor": "metal-command-commit-async",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-commit-async",
                  "source_path": "src/metal/command.zig",
                  "source_line": 273,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L273",
                  "doc": {
                    "summary": "Commit the command buffer for async GPU execution; call `wait` later to synchronize.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Commit the command buffer for async GPU execution; call `wait` later to synchronize."
                  }
                },
                {
                  "name": "wait",
                  "qualified_name": "MetalCommand.wait",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn wait(self: *MetalCommand) void",
                  "anchor": "metal-command-wait",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-wait",
                  "source_path": "src/metal/command.zig",
                  "source_line": 281,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L281",
                  "doc": {
                    "summary": "Block until an async-committed command buffer finishes execution.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Block until an async-committed command buffer finishes execution."
                  }
                },
                {
                  "name": "waitGpuDurationNs",
                  "qualified_name": "MetalCommand.waitGpuDurationNs",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn waitGpuDurationNs(self: *MetalCommand) u64",
                  "anchor": "metal-command-wait-gpu-duration-ns",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-wait-gpu-duration-ns",
                  "source_path": "src/metal/command.zig",
                  "source_line": 289,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L289",
                  "doc": {
                    "summary": "Wait for completion and return Metal's GPU execution duration.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Wait for completion and return Metal's GPU execution duration."
                  }
                },
                {
                  "name": "releaseCompleted",
                  "qualified_name": "MetalCommand.releaseCompleted",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn releaseCompleted(self: *MetalCommand) void",
                  "anchor": "metal-command-release-completed",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-release-completed",
                  "source_path": "src/metal/command.zig",
                  "source_line": 300,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L300",
                  "doc": {
                    "summary": "Release an async command buffer that is known to be completed by a later queue-ordered wait.",
                    "description": [
                      "The shim falls back to waiting if it is still pending."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release an async command buffer that is known to be completed by a later\nqueue-ordered wait. The shim falls back to waiting if it is still pending."
                  }
                },
                {
                  "name": "gpuDurationNs",
                  "qualified_name": "MetalCommand.gpuDurationNs",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn gpuDurationNs(self: *const MetalCommand) u64",
                  "anchor": "metal-command-gpu-duration-ns",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#metal-command-gpu-duration-ns",
                  "source_path": "src/metal/command.zig",
                  "source_line": 308,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L308",
                  "doc": {
                    "summary": "Return Metal-reported GPU execution time for a completed async command.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return Metal-reported GPU execution time for a completed async command."
                  }
                }
              ]
            },
            {
              "name": "beginCommand",
              "qualified_name": "beginCommand",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn beginCommand(ctx: ?*shim.MetalCtx) !MetalCommand",
              "anchor": "begin-command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#begin-command",
              "source_path": "src/metal/command.zig",
              "source_line": 317,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L317",
              "doc": {
                "summary": "Allocate a new command buffer from the given Metal context.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate a new command buffer from the given Metal context."
              },
              "members": []
            },
            {
              "name": "beginCommandWithMode",
              "qualified_name": "beginCommandWithMode",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn beginCommandWithMode(ctx: ?*shim.MetalCtx, mode: CommandEncoderMode) !MetalCommand",
              "anchor": "begin-command-with-mode",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#begin-command-with-mode",
              "source_path": "src/metal/command.zig",
              "source_line": 322,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/command.zig#L322",
              "doc": {
                "summary": "Allocate a command buffer using the requested encoder/barrier policy.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Allocate a command buffer using the requested encoder/barrier policy."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "device",
          "title": "Device",
          "section": "Metal Runtime",
          "summary": "Metal device wrapper — macOS Apple Silicon GPU backend.",
          "overview": [
            "This module owns Metal device initialization and capability queries used by the loader, diagnostics, and Metal inference runtime."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/",
          "source_path": "src/metal/device.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L10",
          "counts": {
            "code_lines": 122,
            "exports": 3,
            "methods": 10,
            "symbols": 13
          },
          "symbols": [
            {
              "name": "GpuFamily",
              "qualified_name": "GpuFamily",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const GpuFamily = enum(u32)",
              "anchor": "gpu-family",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#gpu-family",
              "source_path": "src/metal/device.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L10",
              "doc": {
                "summary": "Public Apple GPU family buckets exposed by the Metal shim.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Public Apple GPU family buckets exposed by the Metal shim."
              },
              "members": [
                {
                  "name": "isApple9OrNewer",
                  "qualified_name": "GpuFamily.isApple9OrNewer",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isApple9OrNewer(self: @This()) bool",
                  "anchor": "gpu-family-is-apple9-or-newer",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#gpu-family-is-apple9-or-newer",
                  "source_path": "src/metal/device.zig",
                  "source_line": 18,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L18",
                  "doc": {
                    "summary": "Return whether the device is Apple9-class or newer.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether the device is Apple9-class or newer."
                  }
                },
                {
                  "name": "isM5Class",
                  "qualified_name": "GpuFamily.isM5Class",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isM5Class(self: @This()) bool",
                  "anchor": "gpu-family-is-m5-class",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#gpu-family-is-m5-class",
                  "source_path": "src/metal/device.zig",
                  "source_line": 26,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L26",
                  "doc": {
                    "summary": "Return whether the device should be treated as M5-class for tuning.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether the device should be treated as M5-class for tuning."
                  }
                }
              ]
            },
            {
              "name": "MetalCapabilities",
              "qualified_name": "MetalCapabilities",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MetalCapabilities = struct",
              "anchor": "metal-capabilities",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-capabilities",
              "source_path": "src/metal/device.zig",
              "source_line": 32,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L32",
              "doc": {
                "summary": "Capability snapshot queried once from the active Metal device.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Capability snapshot queried once from the active Metal device."
              },
              "members": []
            },
            {
              "name": "MetalDevice",
              "qualified_name": "MetalDevice",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MetalDevice = struct",
              "anchor": "metal-device",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device",
              "source_path": "src/metal/device.zig",
              "source_line": 45,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L45",
              "doc": {
                "summary": "Active Metal device wrapper plus capability metadata used by the backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Active Metal device wrapper plus capability metadata used by the backend."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "MetalDevice.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, _: u32) !MetalDevice",
                  "anchor": "metal-device-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-init",
                  "source_path": "src/metal/device.zig",
                  "source_line": 53,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L53",
                  "doc": {
                    "summary": "Initialize the system-default Metal device and query its public capabilities.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Initialize the system-default Metal device and query its public capabilities."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "MetalDevice.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *MetalDevice) void",
                  "anchor": "metal-device-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-deinit",
                  "source_path": "src/metal/device.zig",
                  "source_line": 83,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L83",
                  "doc": {
                    "summary": "Destroy the active Metal device context.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the active Metal device context."
                  }
                },
                {
                  "name": "maxBufferSize",
                  "qualified_name": "MetalDevice.maxBufferSize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxBufferSize(self: *const MetalDevice) u64",
                  "anchor": "metal-device-max-buffer-size",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-max-buffer-size",
                  "source_path": "src/metal/device.zig",
                  "source_line": 91,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L91",
                  "doc": {
                    "summary": "Return the largest single Metal buffer size reported by the driver.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the largest single Metal buffer size reported by the driver."
                  }
                },
                {
                  "name": "totalMemory",
                  "qualified_name": "MetalDevice.totalMemory",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn totalMemory(self: *const MetalDevice) u64",
                  "anchor": "metal-device-total-memory",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-total-memory",
                  "source_path": "src/metal/device.zig",
                  "source_line": 97,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L97",
                  "doc": {
                    "summary": "Return the total unified memory size reported for the active device.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the total unified memory size reported for the active device."
                  }
                },
                {
                  "name": "recommendedMaxWorkingSetSize",
                  "qualified_name": "MetalDevice.recommendedMaxWorkingSetSize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn recommendedMaxWorkingSetSize(self: *const MetalDevice) u64",
                  "anchor": "metal-device-recommended-max-working-set-size",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-recommended-max-working-set-size",
                  "source_path": "src/metal/device.zig",
                  "source_line": 103,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L103",
                  "doc": {
                    "summary": "Return the recommended working-set cap reported by Metal.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the recommended working-set cap reported by Metal."
                  }
                },
                {
                  "name": "maxThreadgroupMemoryLength",
                  "qualified_name": "MetalDevice.maxThreadgroupMemoryLength",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxThreadgroupMemoryLength(self: *const MetalDevice) u64",
                  "anchor": "metal-device-max-threadgroup-memory-length",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-max-threadgroup-memory-length",
                  "source_path": "src/metal/device.zig",
                  "source_line": 108,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L108",
                  "doc": {
                    "summary": "Return the per-threadgroup shared-memory limit reported by Metal.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the per-threadgroup shared-memory limit reported by Metal."
                  }
                },
                {
                  "name": "hasUnifiedMemory",
                  "qualified_name": "MetalDevice.hasUnifiedMemory",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn hasUnifiedMemory(self: *const MetalDevice) bool",
                  "anchor": "metal-device-has-unified-memory",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-has-unified-memory",
                  "source_path": "src/metal/device.zig",
                  "source_line": 113,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L113",
                  "doc": {
                    "summary": "Return whether the active device exposes unified CPU/GPU memory.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether the active device exposes unified CPU/GPU memory."
                  }
                },
                {
                  "name": "supportsRaytracing",
                  "qualified_name": "MetalDevice.supportsRaytracing",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn supportsRaytracing(self: *const MetalDevice) bool",
                  "anchor": "metal-device-supports-raytracing",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#metal-device-supports-raytracing",
                  "source_path": "src/metal/device.zig",
                  "source_line": 118,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/device.zig#L118",
                  "doc": {
                    "summary": "Return whether the active device reports public raytracing support.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether the active device reports public raytracing support."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "kernel-timing",
          "title": "Kernel Timing",
          "section": "Metal Runtime",
          "summary": "Per-kernel Metal dispatch timing probe — default-off, env-flag-gated.",
          "overview": [
            "When `ZINC_METAL_KERNEL_TIMING=1` is set at engine init, every compute dispatch is wrapped in commit+wait+restart inside `MetalCommand.dispatch*` so we can measure CPU-side end-to-end ns per dispatch. The probe is intentionally destructive to throughput (each dispatch becomes a GPU sync point) and is intended ONLY for `--profile` runs where evidence about which kernels dominate dispatch cost matters more than absolute tok/s.",
            "Aggregation is keyed by pipeline pointer plus label. Dispatch sites can set a one-shot label for shape-specific probes; otherwise the label comes from `MetalPipeline.name` set at shader load time in forward_metal.zig."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/",
          "source_path": "src/metal/kernel_timing.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L29",
          "counts": {
            "code_lines": 167,
            "exports": 7,
            "methods": 0,
            "symbols": 7
          },
          "symbols": [
            {
              "name": "enabled",
              "qualified_name": "enabled",
              "declaration_kind": "var",
              "kind": "variable",
              "signature": "pub var enabled: bool = false",
              "anchor": "enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#enabled",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L29",
              "doc": {
                "summary": "Toggled true at engine init when `ZINC_METAL_KERNEL_TIMING=1`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Toggled true at engine init when `ZINC_METAL_KERNEL_TIMING=1`."
              },
              "members": []
            },
            {
              "name": "Entry",
              "qualified_name": "Entry",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Entry = struct",
              "anchor": "entry",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#entry",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L36",
              "doc": {
                "summary": "Snapshot view of one pipeline's aggregated dispatch cost.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Snapshot view of one pipeline's aggregated dispatch cost."
              },
              "members": []
            },
            {
              "name": "enable",
              "qualified_name": "enable",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn enable() void",
              "anchor": "enable",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#enable",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 50,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L50",
              "doc": {
                "summary": "Enable the probe for the rest of the process.",
                "description": [
                  "Idempotent."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Enable the probe for the rest of the process. Idempotent."
              },
              "members": []
            },
            {
              "name": "reset",
              "qualified_name": "reset",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn reset() void",
              "anchor": "reset",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#reset",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 55,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L55",
              "doc": {
                "summary": "Clear accumulated stats.",
                "description": [
                  "Typically called at the start of a profile request."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Clear accumulated stats. Typically called at the start of a profile request."
              },
              "members": []
            },
            {
              "name": "record",
              "qualified_name": "record",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn record(pipe_handle: ?*const anyopaque, name: ?[]const u8, elapsed_ns: u64) void",
              "anchor": "record",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#record",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 64,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L64",
              "doc": {
                "summary": "Record one dispatch worth of elapsed ns against a pipeline.",
                "description": [
                  "Cheap when `enabled` is false (skips early at the call site)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Record one dispatch worth of elapsed ns against a pipeline. Cheap when\n`enabled` is false (skips early at the call site)."
              },
              "members": []
            },
            {
              "name": "topByTotalNs",
              "qualified_name": "topByTotalNs",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn topByTotalNs(buf: []Entry) []Entry",
              "anchor": "top-by-total-ns",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#top-by-total-ns",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 140,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L140",
              "doc": {
                "summary": "Fill `buf` with up to `buf.len` entries ranked by descending total_ns.",
                "description": [
                  "Returns the populated prefix slice."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fill `buf` with up to `buf.len` entries ranked by descending total_ns.\nReturns the populated prefix slice."
              },
              "members": []
            },
            {
              "name": "topByAvgNs",
              "qualified_name": "topByAvgNs",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn topByAvgNs(buf: []Entry) []Entry",
              "anchor": "top-by-avg-ns",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kernel-timing/#top-by-avg-ns",
              "source_path": "src/metal/kernel_timing.zig",
              "source_line": 146,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/kernel_timing.zig#L146",
              "doc": {
                "summary": "Fill `buf` with up to `buf.len` entries ranked by descending avg_ns.",
                "description": [
                  "Returns the populated prefix slice."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fill `buf` with up to `buf.len` entries ranked by descending avg_ns.\nReturns the populated prefix slice."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "pipeline",
          "title": "Pipeline",
          "section": "Metal Runtime",
          "summary": "Metal compute pipeline wrapper — MSL source or precompiled metallib.",
          "overview": [
            "It compiles or loads Metal kernels, exposes the threadgroup capabilities that dispatch code needs for tuning, and keeps pipeline lifecycle handling out of the higher-level runtime and benchmark paths."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/",
          "source_path": "src/metal/pipeline.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/pipeline.zig#L11",
          "counts": {
            "code_lines": 106,
            "exports": 4,
            "methods": 0,
            "symbols": 4
          },
          "symbols": [
            {
              "name": "MetalPipeline",
              "qualified_name": "MetalPipeline",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const MetalPipeline = struct",
              "anchor": "metal-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#metal-pipeline",
              "source_path": "src/metal/pipeline.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/pipeline.zig#L11",
              "doc": {
                "summary": "A compiled Metal compute pipeline state ready for dispatch.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A compiled Metal compute pipeline state ready for dispatch."
              },
              "members": []
            },
            {
              "name": "createPipeline",
              "qualified_name": "createPipeline",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createPipeline(ctx: ?*shim.MetalCtx, msl_source: [*:0]const u8, fn_name: [*:0]const u8) !MetalPipeline",
              "anchor": "create-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-pipeline",
              "source_path": "src/metal/pipeline.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/pipeline.zig#L26",
              "doc": {
                "summary": "Compile an MSL source string into a compute pipeline for the given function name.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Compile an MSL source string into a compute pipeline for the given function name."
              },
              "members": []
            },
            {
              "name": "createPipelineFromLib",
              "qualified_name": "createPipelineFromLib",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createPipelineFromLib(ctx: ?*shim.MetalCtx, lib_data: [*]const u8, lib_size: usize, fn_name: [*:0]const u8) !MetalPipeline",
              "anchor": "create-pipeline-from-lib",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-pipeline-from-lib",
              "source_path": "src/metal/pipeline.zig",
              "source_line": 49,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/pipeline.zig#L49",
              "doc": {
                "summary": "Create a compute pipeline from a precompiled metallib binary blob.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Create a compute pipeline from a precompiled metallib binary blob."
              },
              "members": []
            },
            {
              "name": "freePipeline",
              "qualified_name": "freePipeline",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freePipeline(pipe: *MetalPipeline) void",
              "anchor": "free-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#free-pipeline",
              "source_path": "src/metal/pipeline.zig",
              "source_line": 61,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/metal/pipeline.zig#L61",
              "doc": {
                "summary": "Release the pipeline handle.",
                "description": [
                  "Safe to call with a null handle."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Release the pipeline handle. Safe to call with a null handle."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "managed-models",
      "title": "Managed Models",
      "description": "Catalog metadata, cache management, model downloads, and active-selection helpers used by the CLI and server.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#managed-models",
      "module_count": 4,
      "symbol_count": 68,
      "modules": [
        {
          "slug": "catalog",
          "title": "Catalog",
          "section": "Managed Models",
          "summary": "Curated catalog of ZINC-supported managed GGUF models.",
          "overview": [
            "The catalog is intentionally small and only includes models that ZINC has explicitly validated for the listed GPU profiles."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/",
          "source_path": "src/model/catalog.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L9",
          "counts": {
            "code_lines": 429,
            "exports": 18,
            "methods": 0,
            "symbols": 18
          },
          "symbols": [
            {
              "name": "CatalogStatus",
              "qualified_name": "CatalogStatus",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const CatalogStatus = enum",
              "anchor": "catalog-status",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#catalog-status",
              "source_path": "src/model/catalog.zig",
              "source_line": 9,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L9",
              "doc": {
                "summary": "Lifecycle status of a catalog entry, controlling visibility and UI treatment.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Lifecycle status of a catalog entry, controlling visibility and UI treatment."
              },
              "members": []
            },
            {
              "name": "CatalogEntry",
              "qualified_name": "CatalogEntry",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CatalogEntry = struct",
              "anchor": "catalog-entry",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#catalog-entry",
              "source_path": "src/model/catalog.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L18",
              "doc": {
                "summary": "A single managed-model entry describing its identity, download location, hardware requirements, and tested GPU profiles.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A single managed-model entry describing its identity, download location,\nhardware requirements, and tested GPU profiles."
              },
              "members": []
            },
            {
              "name": "FitState",
              "qualified_name": "FitState",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const FitState = enum",
              "anchor": "fit-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#fit-state",
              "source_path": "src/model/catalog.zig",
              "source_line": 48,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L48",
              "doc": {
                "summary": "VRAM-fit assessment for a catalog entry against a specific GPU budget.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VRAM-fit assessment for a catalog entry against a specific GPU budget."
              },
              "members": []
            },
            {
              "name": "apple_silicon_profile",
              "qualified_name": "apple_silicon_profile",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const apple_silicon_profile = \"apple-silicon\"",
              "anchor": "apple-silicon-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#apple-silicon-profile",
              "source_path": "src/model/catalog.zig",
              "source_line": 60,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L60",
              "doc": {
                "summary": "Shared GPU profile string used for all Apple Silicon (Metal) devices.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Shared GPU profile string used for all Apple Silicon (Metal) devices."
              },
              "members": []
            },
            {
              "name": "entries",
              "qualified_name": "entries",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const entries = [_]CatalogEntry{",
              "anchor": "entries",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#entries",
              "source_path": "src/model/catalog.zig",
              "source_line": 63,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L63",
              "doc": {
                "summary": "The complete list of ZINC-validated managed models available for download.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "The complete list of ZINC-validated managed models available for download."
              },
              "members": []
            },
            {
              "name": "find",
              "qualified_name": "find",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn find(id: []const u8) ?*const CatalogEntry",
              "anchor": "find",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#find",
              "source_path": "src/model/catalog.zig",
              "source_line": 195,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L195",
              "doc": {
                "summary": "Look up a catalog entry by its short identifier, returning null if not found.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Look up a catalog entry by its short identifier, returning null if not found."
              },
              "members": []
            },
            {
              "name": "findForLoadedModel",
              "qualified_name": "findForLoadedModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn findForLoadedModel(managed_id: ?[]const u8, model_path: []const u8, display_name: []const u8) ?*const CatalogEntry",
              "anchor": "find-for-loaded-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#find-for-loaded-model",
              "source_path": "src/model/catalog.zig",
              "source_line": 228,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L228",
              "doc": {
                "summary": "Match a loaded model back to a catalog entry, even when it was opened from a raw path instead of a managed-model id.",
                "description": [
                  "Resolution order: managed id → parent directory name (for managed-cache `model.gguf` paths) → file-name exact match → file-name compact-case-insensitive match → display-name fuzzy match."
                ],
                "params": [
                  {
                    "name": "managed_id",
                    "description": "Optional catalog id previously recorded for this model; tried first."
                  },
                  {
                    "name": "model_path",
                    "description": "Absolute filesystem path to the GGUF file being loaded."
                  },
                  {
                    "name": "display_name",
                    "description": "Human-readable name used as a last-resort fuzzy key."
                  }
                ],
                "returns": "Pointer into `entries`, or null when no catalog entry matches.",
                "notes": [],
                "raw": "Match a loaded model back to a catalog entry, even when it was opened from a\nraw path instead of a managed-model id. Resolution order: managed id → parent\ndirectory name (for managed-cache `model.gguf` paths) → file-name exact match\n→ file-name compact-case-insensitive match → display-name fuzzy match."
              },
              "members": []
            },
            {
              "name": "profileForGpu",
              "qualified_name": "profileForGpu",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn profileForGpu(config: gpu_detect.GpuConfig) []const u8",
              "anchor": "profile-for-gpu",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#profile-for-gpu",
              "source_path": "src/model/catalog.zig",
              "source_line": 262,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L262",
              "doc": {
                "summary": "Map a detected Vulkan GPU configuration to its catalog profile string.",
                "description": [
                  "RDNA4 is split by VRAM tier (≥28 GiB → \"amd-rdna4-32gb\", ≥14 GiB → \"amd-rdna4-16gb\", otherwise \"amd-rdna4-small\"); RDNA3 is split by VRAM tier (≥14 GiB → \"amd-rdna3-16gb\", otherwise \"amd-rdna3-small\"); all other vendors map to a single string each."
                ],
                "params": [
                  {
                    "name": "config",
                    "description": "GPU vendor/VRAM description produced by `gpu_detect`."
                  }
                ],
                "returns": "Catalog profile key that can be matched against `CatalogEntry.tested_profiles`.",
                "notes": [],
                "raw": "Map a detected Vulkan GPU configuration to its catalog profile string.\nRDNA4 is split by VRAM tier (≥28 GiB → \"amd-rdna4-32gb\", ≥14 GiB →\n\"amd-rdna4-16gb\", otherwise \"amd-rdna4-small\"); RDNA3 is split by VRAM\ntier (≥14 GiB → \"amd-rdna3-16gb\", otherwise \"amd-rdna3-small\"); all\nother vendors map to a single string each."
              },
              "members": []
            },
            {
              "name": "profileForMetal",
              "qualified_name": "profileForMetal",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn profileForMetal() []const u8",
              "anchor": "profile-for-metal",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#profile-for-metal",
              "source_path": "src/model/catalog.zig",
              "source_line": 276,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L276",
              "doc": {
                "summary": "Return the catalog profile string for Apple Silicon Metal devices.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return the catalog profile string for Apple Silicon Metal devices."
              },
              "members": []
            },
            {
              "name": "nvidia_cuda_profile",
              "qualified_name": "nvidia_cuda_profile",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const nvidia_cuda_profile = \"nvidia-cuda\"",
              "anchor": "nvidia-cuda-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#nvidia-cuda-profile",
              "source_path": "src/model/catalog.zig",
              "source_line": 281,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L281",
              "doc": {
                "summary": "Shared GPU profile string used for all NVIDIA (CUDA) devices.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Shared GPU profile string used for all NVIDIA (CUDA) devices."
              },
              "members": []
            },
            {
              "name": "profileForCuda",
              "qualified_name": "profileForCuda",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn profileForCuda() []const u8",
              "anchor": "profile-for-cuda",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#profile-for-cuda",
              "source_path": "src/model/catalog.zig",
              "source_line": 286,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L286",
              "doc": {
                "summary": "Return the catalog profile string for NVIDIA CUDA devices.",
                "description": [
                  "The CUDA backend does not split by VRAM tier the way Vulkan/RDNA4 does — fit is decided by the live `freeMemory()` budget — so a single profile string is sufficient."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return the catalog profile string for NVIDIA CUDA devices. The CUDA backend\ndoes not split by VRAM tier the way Vulkan/RDNA4 does — fit is decided by the\nlive `freeMemory()` budget — so a single profile string is sufficient."
              },
              "members": []
            },
            {
              "name": "supportsProfile",
              "qualified_name": "supportsProfile",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn supportsProfile(entry: CatalogEntry, profile: []const u8) bool",
              "anchor": "supports-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#supports-profile",
              "source_path": "src/model/catalog.zig",
              "source_line": 294,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L294",
              "doc": {
                "summary": "Return whether the entry has been tested on the given GPU profile.",
                "description": [],
                "params": [
                  {
                    "name": "entry",
                    "description": "Catalog entry to check."
                  },
                  {
                    "name": "profile",
                    "description": "Profile string such as `\"amd-rdna4-32gb\"` or `apple_silicon_profile`."
                  }
                ],
                "returns": "true if `profile` appears in `entry.tested_profiles`.",
                "notes": [],
                "raw": "Return whether the entry has been tested on the given GPU profile."
              },
              "members": []
            },
            {
              "name": "fitsGpu",
              "qualified_name": "fitsGpu",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn fitsGpu(entry: CatalogEntry, vram_budget_bytes: u64) bool",
              "anchor": "fits-gpu",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#fits-gpu",
              "source_path": "src/model/catalog.zig",
              "source_line": 304,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L304",
              "doc": {
                "summary": "Return whether the model's VRAM requirement fits within the given budget without enabling MoE offload.",
                "description": [
                  "Strict — does not consider the offload escape hatch. Use `fitState` for the offload-aware tri-state assessment."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return whether the model's VRAM requirement fits within the given budget\nwithout enabling MoE offload. Strict — does not consider the offload escape\nhatch. Use `fitState` for the offload-aware tri-state assessment."
              },
              "members": []
            },
            {
              "name": "requiredVramWithOffload",
              "qualified_name": "requiredVramWithOffload",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn requiredVramWithOffload(entry: CatalogEntry) u64",
              "anchor": "required-vram-with-offload",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#required-vram-with-offload",
              "source_path": "src/model/catalog.zig",
              "source_line": 310,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L310",
              "doc": {
                "summary": "VRAM required when MoE expert tensors are offloaded to host RAM.",
                "description": [
                  "Equal to `required_vram_bytes` for dense models (no offloadable tensors)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VRAM required when MoE expert tensors are offloaded to host RAM. Equal to\n`required_vram_bytes` for dense models (no offloadable tensors)."
              },
              "members": []
            },
            {
              "name": "fitState",
              "qualified_name": "fitState",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn fitState(entry: CatalogEntry, vram_budget_bytes: u64) FitState",
              "anchor": "fit-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#fit-state",
              "source_path": "src/model/catalog.zig",
              "source_line": 318,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L318",
              "doc": {
                "summary": "Tri-state fit assessment that distinguishes \"fits as-is\" from \"fits only with `ZINC_OFFLOAD_MOE_EXPERTS=1`\".",
                "description": [
                  "Use this to surface the offload escape hatch to users when a model would otherwise look unsupported."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tri-state fit assessment that distinguishes \"fits as-is\" from \"fits only\nwith `ZINC_OFFLOAD_MOE_EXPERTS=1`\". Use this to surface the offload escape\nhatch to users when a model would otherwise look unsupported."
              },
              "members": []
            },
            {
              "name": "requiresOffloadToFit",
              "qualified_name": "requiresOffloadToFit",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn requiresOffloadToFit(entry: CatalogEntry, vram_budget_bytes: u64) bool",
              "anchor": "requires-offload-to-fit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#requires-offload-to-fit",
              "source_path": "src/model/catalog.zig",
              "source_line": 326,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L326",
              "doc": {
                "summary": "Return true when the model needs `ZINC_OFFLOAD_MOE_EXPERTS=1` to fit (does not fit by itself but does fit with offload enabled).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return true when the model needs `ZINC_OFFLOAD_MOE_EXPERTS=1` to fit\n(does not fit by itself but does fit with offload enabled)."
              },
              "members": []
            },
            {
              "name": "supportedOnCurrentGpu",
              "qualified_name": "supportedOnCurrentGpu",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn supportedOnCurrentGpu(entry: CatalogEntry, profile: []const u8, vram_budget_bytes: u64) bool",
              "anchor": "supported-on-current-gpu",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#supported-on-current-gpu",
              "source_path": "src/model/catalog.zig",
              "source_line": 336,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L336",
              "doc": {
                "summary": "Return whether the model is both tested on the given profile and fits in VRAM without MoE offload.",
                "description": [
                  "Equivalent to `supportsProfile and fitsGpu`."
                ],
                "params": [
                  {
                    "name": "entry",
                    "description": "Catalog entry to evaluate."
                  },
                  {
                    "name": "profile",
                    "description": "Detected GPU profile string (e.g. from `profileForGpu`)."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Available VRAM budget in bytes."
                  }
                ],
                "returns": "true only when both conditions hold; does not consider offload.",
                "notes": [],
                "raw": "Return whether the model is both tested on the given profile and fits in VRAM\nwithout MoE offload. Equivalent to `supportsProfile and fitsGpu`."
              },
              "members": []
            },
            {
              "name": "ggufArchForFamily",
              "qualified_name": "ggufArchForFamily",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn ggufArchForFamily(family: []const u8) ?[]const u8",
              "anchor": "gguf-arch-for-family",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/catalog/#gguf-arch-for-family",
              "source_path": "src/model/catalog.zig",
              "source_line": 347,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/catalog.zig#L347",
              "doc": {
                "summary": "Map a catalog family string to the GGUF architecture string that models in that family use.",
                "description": [
                  "Returns null for unrecognized families — the caller should treat that as an error (a catalog entry with no known architecture mapping). Note that `\"qwen3.5\"` and `\"qwen3.6\"` both map to `\"qwen35\"` because the GGUF file declares the SSM+attention hybrid architecture under that name."
                ],
                "params": [
                  {
                    "name": "family",
                    "description": "Value of `CatalogEntry.family` (e.g. `\"gemma4\"`, `\"qwen3.6\"`)."
                  }
                ],
                "returns": "GGUF architecture identifier, or null if the family is not recognized.",
                "notes": [],
                "raw": "Map a catalog family string to the GGUF architecture string that models in\nthat family use. Returns null for unrecognized families — the caller should\ntreat that as an error (a catalog entry with no known architecture mapping).\nNote that `\"qwen3.5\"` and `\"qwen3.6\"` both map to `\"qwen35\"` because the\nGGUF file declares the SSM+attention hybrid architecture under that name."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "hf",
          "title": "Hf",
          "section": "Managed Models",
          "summary": "Resolve and download Hugging Face GGUF models for the `-hf` CLI flag.",
          "overview": [
            "Turns an `owner/repo[:quant]` spec into an installed GGUF in the managed model cache, resolving the concrete file name via the Hugging Face `/v2/<repo>/manifests/<tag>` endpoint and reusing the managed download pipeline for transfer, staging, and manifest bookkeeping."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/hf/",
          "source_path": "src/model/hf.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/hf.zig#L36",
          "counts": {
            "code_lines": 405,
            "exports": 4,
            "methods": 0,
            "symbols": 4
          },
          "symbols": [
            {
              "name": "Spec",
              "qualified_name": "Spec",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Spec = struct",
              "anchor": "spec",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/hf/#spec",
              "source_path": "src/model/hf.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/hf.zig#L36",
              "doc": {
                "summary": "Parsed `-hf` argument: a Hugging Face repo plus a quantization tag.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Parsed `-hf` argument: a Hugging Face repo plus a quantization tag."
              },
              "members": []
            },
            {
              "name": "parseSpec",
              "qualified_name": "parseSpec",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn parseSpec(text: []const u8) !Spec",
              "anchor": "parse-spec",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/hf/#parse-spec",
              "source_path": "src/model/hf.zig",
              "source_line": 53,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/hf.zig#L53",
              "doc": {
                "summary": "Parses an `-hf` argument of the form `owner/repo[:quant]`.",
                "description": [
                  "The quantization suffix is optional; when absent the tag defaults to `latest`, which the Hugging Face manifest endpoint resolves to the repo's recommended quantization. Each component (owner, repo, tag) must match the Hugging Face naming grammar; anything else fails with `error.InvalidHfSpec`."
                ],
                "params": [
                  {
                    "name": "text",
                    "description": "Raw CLI argument value."
                  }
                ],
                "returns": "A `Spec` whose slices point into `text`.",
                "notes": [],
                "raw": "Parses an `-hf` argument of the form `owner/repo[:quant]`.\n\nThe quantization suffix is optional; when absent the tag defaults to\n`latest`, which the Hugging Face manifest endpoint resolves to the repo's\nrecommended quantization. Each component (owner, repo, tag) must match\nthe Hugging Face naming grammar; anything else fails with\n`error.InvalidHfSpec`."
              },
              "members": []
            },
            {
              "name": "cacheId",
              "qualified_name": "cacheId",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn cacheId(allocator: std.mem.Allocator, spec: Spec) ![]u8",
              "anchor": "cache-id",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/hf/#cache-id",
              "source_path": "src/model/hf.zig",
              "source_line": 100,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/hf.zig#L100",
              "doc": {
                "summary": "Derives the managed-cache model id for a Hugging Face spec.",
                "description": [
                  "The id is a single filesystem-safe path component so the download can live in the same `<cache_root>/models/<id>/model.gguf` layout as catalog models. Distinct specs map to distinct ids; `:latest` is cached separately from an explicit quantization even if both resolve to the same upstream file."
                ],
                "params": [
                  {
                    "name": "allocator",
                    "description": "Owns the returned id slice."
                  },
                  {
                    "name": "spec",
                    "description": "Parsed Hugging Face spec."
                  }
                ],
                "returns": "Heap-allocated id like `hf--unsloth--qwen3.5-9b-gguf--q4_k_m`.",
                "notes": [],
                "raw": "Derives the managed-cache model id for a Hugging Face spec.\n\nThe id is a single filesystem-safe path component so the download can\nlive in the same `<cache_root>/models/<id>/model.gguf` layout as catalog\nmodels. Distinct specs map to distinct ids; `:latest` is cached\nseparately from an explicit quantization even if both resolve to the\nsame upstream file."
              },
              "members": []
            },
            {
              "name": "ensureModel",
              "qualified_name": "ensureModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn ensureModel(spec_text: []const u8, allocator: std.mem.Allocator, writer: anytype) ![]u8",
              "anchor": "ensure-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/hf/#ensure-model",
              "source_path": "src/model/hf.zig",
              "source_line": 130,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/hf.zig#L130",
              "doc": {
                "summary": "Ensures the model described by an `-hf` spec is installed and returns its path.",
                "description": [
                  "If the spec is already cached the installed path is returned without any network access. Otherwise the GGUF file name and sha256 digest are resolved via the Hugging Face manifest endpoint and the file is downloaded through the managed pull pipeline (staged `.partial` file, progress bar, manifest write), which verifies the download against the pinned digest when the manifest provides one. quantizations with no kernels (`error.UnsupportedQuantization`, detected from the tag and the resolved file name) and architectures the loader does not recognise (`error.UnsupportedArchitecture`, detected from repo metadata when available)."
                ],
                "params": [
                  {
                    "name": "spec_text",
                    "description": "Raw `-hf` argument (`owner/repo[:quant]`)."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for HTTP, path construction, and the returned path."
                  },
                  {
                    "name": "writer",
                    "description": "Receives human-readable status lines and download progress."
                  }
                ],
                "returns": "Heap-allocated absolute path to the installed GGUF; caller owns it.",
                "notes": [
                  "Models zinc cannot run are rejected before the download starts:",
                  "Gated or private repos are not supported: they fail with `error.HfAuthRequired`."
                ],
                "raw": "Ensures the model described by an `-hf` spec is installed and returns its path.\n\nIf the spec is already cached the installed path is returned without any\nnetwork access. Otherwise the GGUF file name and sha256 digest are\nresolved via the Hugging Face manifest endpoint and the file is\ndownloaded through the managed pull pipeline (staged `.partial` file,\nprogress bar, manifest write), which verifies the download against the\npinned digest when the manifest provides one.\nquantizations with no kernels (`error.UnsupportedQuantization`, detected\nfrom the tag and the resolved file name) and architectures the loader\ndoes not recognise (`error.UnsupportedArchitecture`, detected from repo\nmetadata when available)."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "managed",
          "title": "Managed",
          "section": "Managed Models",
          "summary": "Managed model cache, active-model selection, and download helpers.",
          "overview": [
            "These helpers back the `zinc model ...` CLI and the server-side active-model switching flow."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/",
          "source_path": "src/model/managed.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L13",
          "counts": {
            "code_lines": 1044,
            "exports": 25,
            "methods": 4,
            "symbols": 29
          },
          "symbols": [
            {
              "name": "RuntimePaths",
              "qualified_name": "RuntimePaths",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RuntimePaths = struct",
              "anchor": "runtime-paths",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#runtime-paths",
              "source_path": "src/model/managed.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L13",
              "doc": {
                "summary": "Resolved cache and config directory paths for the current platform.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Resolved cache and config directory paths for the current platform."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "RuntimePaths.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *RuntimePaths, allocator: std.mem.Allocator) void",
                  "anchor": "runtime-paths-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#runtime-paths-deinit",
                  "source_path": "src/model/managed.zig",
                  "source_line": 18,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L18",
                  "doc": {
                    "summary": "Frees the owned path slices and invalidates the struct.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Frees the owned path slices and invalidates the struct."
                  }
                }
              ]
            },
            {
              "name": "ModelFit",
              "qualified_name": "ModelFit",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelFit = struct",
              "anchor": "model-fit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#model-fit",
              "source_path": "src/model/managed.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L26",
              "doc": {
                "summary": "VRAM budget check result for a single catalog model.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "VRAM budget check result for a single catalog model."
              },
              "members": []
            },
            {
              "name": "ActiveSelection",
              "qualified_name": "ActiveSelection",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ActiveSelection = struct",
              "anchor": "active-selection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#active-selection",
              "source_path": "src/model/managed.zig",
              "source_line": 40,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L40",
              "doc": {
                "summary": "The currently active managed model as persisted in the config directory.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "The currently active managed model as persisted in the config directory."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "ActiveSelection.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ActiveSelection, allocator: std.mem.Allocator) void",
                  "anchor": "active-selection-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#active-selection-deinit",
                  "source_path": "src/model/managed.zig",
                  "source_line": 45,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L45",
                  "doc": {
                    "summary": "Frees the owned model_id slice and invalidates the struct.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Frees the owned model_id slice and invalidates the struct."
                  }
                }
              ]
            },
            {
              "name": "CachedGpuProfile",
              "qualified_name": "CachedGpuProfile",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CachedGpuProfile = struct",
              "anchor": "cached-gpu-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#cached-gpu-profile",
              "source_path": "src/model/managed.zig",
              "source_line": 52,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L52",
              "doc": {
                "summary": "Cached GPU capability profile used to avoid re-probing the device on every run.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Cached GPU capability profile used to avoid re-probing the device on every run."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "CachedGpuProfile.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *CachedGpuProfile, allocator: std.mem.Allocator) void",
                  "anchor": "cached-gpu-profile-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#cached-gpu-profile-deinit",
                  "source_path": "src/model/managed.zig",
                  "source_line": 59,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L59",
                  "doc": {
                    "summary": "Frees the owned string slices and invalidates the struct.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Frees the owned string slices and invalidates the struct."
                  }
                }
              ]
            },
            {
              "name": "InstalledManifest",
              "qualified_name": "InstalledManifest",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const InstalledManifest = struct",
              "anchor": "installed-manifest",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#installed-manifest",
              "source_path": "src/model/managed.zig",
              "source_line": 73,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L73",
              "doc": {
                "summary": "On-disk manifest written alongside an installed GGUF model file.",
                "description": [
                  "`sha256` is optional: hand-rolled manifests for symlinked local files (e.g. `download_url:\"local\"`) frequently omit it because the user can't or won't precompute the digest of an existing GGUF. Treat it as a hint, not a required field — the catalog's `sha256` is the source of truth when a checksum needs to be enforced."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "On-disk manifest written alongside an installed GGUF model file.\n\n`sha256` is optional: hand-rolled manifests for symlinked local files\n(e.g. `download_url:\"local\"`) frequently omit it because the user can't\nor won't precompute the digest of an existing GGUF. Treat it as a hint,\nnot a required field — the catalog's `sha256` is the source of truth\nwhen a checksum needs to be enforced."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "InstalledManifest.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *InstalledManifest, allocator: std.mem.Allocator) void",
                  "anchor": "installed-manifest-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#installed-manifest-deinit",
                  "source_path": "src/model/managed.zig",
                  "source_line": 83,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L83",
                  "doc": {
                    "summary": "Frees the owned sha256 slice (if any) and invalidates the struct.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Frees the owned sha256 slice (if any) and invalidates the struct."
                  }
                }
              ]
            },
            {
              "name": "RemoveInstalledModelResult",
              "qualified_name": "RemoveInstalledModelResult",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const RemoveInstalledModelResult = struct",
              "anchor": "remove-installed-model-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#remove-installed-model-result",
              "source_path": "src/model/managed.zig",
              "source_line": 90,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L90",
              "doc": {
                "summary": "Outcome of a model removal: which artifacts were actually deleted.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Outcome of a model removal: which artifacts were actually deleted."
              },
              "members": []
            },
            {
              "name": "DownloadObserver",
              "qualified_name": "DownloadObserver",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const DownloadObserver = struct",
              "anchor": "download-observer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#download-observer",
              "source_path": "src/model/managed.zig",
              "source_line": 97,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L97",
              "doc": {
                "summary": "Callback hooks for observing model download lifecycle events.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Callback hooks for observing model download lifecycle events."
              },
              "members": []
            },
            {
              "name": "runtimePaths",
              "qualified_name": "runtimePaths",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn runtimePaths(allocator: std.mem.Allocator) !RuntimePaths",
              "anchor": "runtime-paths",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#runtime-paths",
              "source_path": "src/model/managed.zig",
              "source_line": 197,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L197",
              "doc": {
                "summary": "Returns the resolved cache and config root directories for the current platform.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Returns the resolved cache and config root directories for the current platform."
              },
              "members": []
            },
            {
              "name": "resolveInstalledModelPath",
              "qualified_name": "resolveInstalledModelPath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveInstalledModelPath(model_id: []const u8, allocator: std.mem.Allocator) ![]u8",
              "anchor": "resolve-installed-model-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#resolve-installed-model-path",
              "source_path": "src/model/managed.zig",
              "source_line": 228,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L228",
              "doc": {
                "summary": "Returns the absolute path to the installed GGUF file for the given model id.",
                "description": [
                  "`error.InvalidModelId`, so no caller can resolve a path outside the cache."
                ],
                "params": [
                  {
                    "name": "model_id",
                    "description": "Catalog model identifier (e.g. `\"qwen3-2b\"`)."
                  },
                  {
                    "name": "allocator",
                    "description": "Used to build the path; caller owns the returned slice."
                  }
                ],
                "returns": "Heap-allocated absolute path `<cache_root>/models/<model_id>/model.gguf`.",
                "notes": [
                  "Ids that are not a single filesystem-safe path component fail with"
                ],
                "raw": "Returns the absolute path to the installed GGUF file for the given model id.\n\n`error.InvalidModelId`, so no caller can resolve a path outside the cache."
              },
              "members": []
            },
            {
              "name": "resolveManifestPath",
              "qualified_name": "resolveManifestPath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveManifestPath(model_id: []const u8, allocator: std.mem.Allocator) ![]u8",
              "anchor": "resolve-manifest-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#resolve-manifest-path",
              "source_path": "src/model/managed.zig",
              "source_line": 242,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L242",
              "doc": {
                "summary": "Returns the absolute path to the manifest JSON for the given model id.",
                "description": [
                  "`error.InvalidModelId`, so no caller can resolve a path outside the cache."
                ],
                "params": [
                  {
                    "name": "model_id",
                    "description": "Catalog model identifier."
                  },
                  {
                    "name": "allocator",
                    "description": "Used to build the path; caller owns the returned slice."
                  }
                ],
                "returns": "Heap-allocated absolute path `<cache_root>/models/<model_id>/manifest.json`.",
                "notes": [
                  "Ids that are not a single filesystem-safe path component fail with"
                ],
                "raw": "Returns the absolute path to the manifest JSON for the given model id.\n\n`error.InvalidModelId`, so no caller can resolve a path outside the cache."
              },
              "members": []
            },
            {
              "name": "resolveActiveConfigPath",
              "qualified_name": "resolveActiveConfigPath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveActiveConfigPath(allocator: std.mem.Allocator) ![]u8",
              "anchor": "resolve-active-config-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#resolve-active-config-path",
              "source_path": "src/model/managed.zig",
              "source_line": 250,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L250",
              "doc": {
                "summary": "Returns the absolute path to the active-model config file.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Returns the absolute path to the active-model config file."
              },
              "members": []
            },
            {
              "name": "resolveGpuProfileCachePath",
              "qualified_name": "resolveGpuProfileCachePath",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn resolveGpuProfileCachePath(device_index: u32, allocator: std.mem.Allocator) ![]u8",
              "anchor": "resolve-gpu-profile-cache-path",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#resolve-gpu-profile-cache-path",
              "source_path": "src/model/managed.zig",
              "source_line": 261,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L261",
              "doc": {
                "summary": "Returns the absolute path to the cached GPU profile JSON for the given device index.",
                "description": [],
                "params": [
                  {
                    "name": "device_index",
                    "description": "Zero-based index of the GPU device; encoded in the filename."
                  },
                  {
                    "name": "allocator",
                    "description": "Used to build the path; caller owns the returned slice."
                  }
                ],
                "returns": "Heap-allocated absolute path `<config_root>/gpu-profile-device-<device_index>.json`.",
                "notes": [],
                "raw": "Returns the absolute path to the cached GPU profile JSON for the given device index."
              },
              "members": []
            },
            {
              "name": "isInstalled",
              "qualified_name": "isInstalled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn isInstalled(model_id: []const u8, allocator: std.mem.Allocator) bool",
              "anchor": "is-installed",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#is-installed",
              "source_path": "src/model/managed.zig",
              "source_line": 268,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L268",
              "doc": {
                "summary": "Returns true if the model GGUF file exists in the local cache.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Returns true if the model GGUF file exists in the local cache."
              },
              "members": []
            },
            {
              "name": "readActiveSelection",
              "qualified_name": "readActiveSelection",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn readActiveSelection(allocator: std.mem.Allocator) !?ActiveSelection",
              "anchor": "read-active-selection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#read-active-selection",
              "source_path": "src/model/managed.zig",
              "source_line": 276,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L276",
              "doc": {
                "summary": "Reads the persisted active-model selection, or returns null if none is set.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Reads the persisted active-model selection, or returns null if none is set."
              },
              "members": []
            },
            {
              "name": "writeActiveSelection",
              "qualified_name": "writeActiveSelection",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn writeActiveSelection(model_id: []const u8, allocator: std.mem.Allocator) !void",
              "anchor": "write-active-selection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#write-active-selection",
              "source_path": "src/model/managed.zig",
              "source_line": 302,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L302",
              "doc": {
                "summary": "Persists the given model id as the active selection with the current timestamp.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Persists the given model id as the active selection with the current timestamp."
              },
              "members": []
            },
            {
              "name": "clearActiveSelection",
              "qualified_name": "clearActiveSelection",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn clearActiveSelection(allocator: std.mem.Allocator) !bool",
              "anchor": "clear-active-selection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#clear-active-selection",
              "source_path": "src/model/managed.zig",
              "source_line": 322,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L322",
              "doc": {
                "summary": "Removes the active-model config file.",
                "description": [
                  "Returns true if a file was deleted."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Removes the active-model config file. Returns true if a file was deleted."
              },
              "members": []
            },
            {
              "name": "clearActiveSelectionIfMatches",
              "qualified_name": "clearActiveSelectionIfMatches",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn clearActiveSelectionIfMatches(model_id: []const u8, allocator: std.mem.Allocator) !bool",
              "anchor": "clear-active-selection-if-matches",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#clear-active-selection-if-matches",
              "source_path": "src/model/managed.zig",
              "source_line": 329,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L329",
              "doc": {
                "summary": "Clears the active selection only if it currently points to the given model id.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Clears the active selection only if it currently points to the given model id."
              },
              "members": []
            },
            {
              "name": "readCachedGpuProfile",
              "qualified_name": "readCachedGpuProfile",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn readCachedGpuProfile(device_index: u32, allocator: std.mem.Allocator) !?CachedGpuProfile",
              "anchor": "read-cached-gpu-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#read-cached-gpu-profile",
              "source_path": "src/model/managed.zig",
              "source_line": 341,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L341",
              "doc": {
                "summary": "Reads the cached GPU profile for the given device, or returns null if not cached.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Reads the cached GPU profile for the given device, or returns null if not cached."
              },
              "members": []
            },
            {
              "name": "writeCachedGpuProfile",
              "qualified_name": "writeCachedGpuProfile",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn writeCachedGpuProfile( device_index: u32, profile: []const u8, device_name: []const u8, vram_budget_bytes: u64, allocator: std.mem.Allocator, ) !void",
              "anchor": "write-cached-gpu-profile",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#write-cached-gpu-profile",
              "source_path": "src/model/managed.zig",
              "source_line": 379,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L379",
              "doc": {
                "summary": "Persists a GPU capability profile to disk for the given device index.",
                "description": [
                  "Overwrites any existing cache file for that device."
                ],
                "params": [
                  {
                    "name": "device_index",
                    "description": "Zero-based GPU index; used to derive the cache file name."
                  },
                  {
                    "name": "profile",
                    "description": "Opaque profile string (e.g. `\"rdna4\"`) returned by the diagnostics layer."
                  },
                  {
                    "name": "device_name",
                    "description": "Human-readable device name stored for informational display."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Effective VRAM budget in bytes for this device."
                  },
                  {
                    "name": "allocator",
                    "description": "Used only for path construction; nothing is retained after the call."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Persists a GPU capability profile to disk for the given device index.\n\nOverwrites any existing cache file for that device."
              },
              "members": []
            },
            {
              "name": "describeFit",
              "qualified_name": "describeFit",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn describeFit(entry: catalog.CatalogEntry, vram_budget_bytes: u64, allocator: std.mem.Allocator) !ModelFit",
              "anchor": "describe-fit",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#describe-fit",
              "source_path": "src/model/managed.zig",
              "source_line": 419,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L419",
              "doc": {
                "summary": "Returns a VRAM fit assessment for a catalog model against the given budget.",
                "description": [
                  "If the model is installed, the on-disk manifest is consulted first (most accurate); if the manifest lacks VRAM fields, the installed GGUF is inspected directly and the manifest is updated. For models that are not yet installed, catalog static estimates are used and `ModelFit.exact` is false."
                ],
                "params": [
                  {
                    "name": "entry",
                    "description": "Catalog entry describing the model to assess."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Available VRAM in bytes on the target device."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for path resolution and manifest I/O; nothing is retained."
                  }
                ],
                "returns": "`ModelFit` with exact=true when data came from the installed model (manifest or file inspection), false for catalog estimates.",
                "notes": [],
                "raw": "Returns a VRAM fit assessment for a catalog model against the given budget.\n\nIf the model is installed, the on-disk manifest is consulted first (most\naccurate); if the manifest lacks VRAM fields, the installed GGUF is\ninspected directly and the manifest is updated. For models that are not yet\ninstalled, catalog static estimates are used and `ModelFit.exact` is false."
              },
              "members": []
            },
            {
              "name": "verifyActiveSelectionFits",
              "qualified_name": "verifyActiveSelectionFits",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn verifyActiveSelectionFits(model_id: []const u8, vram_budget_bytes: u64, allocator: std.mem.Allocator) !ModelFit",
              "anchor": "verify-active-selection-fits",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#verify-active-selection-fits",
              "source_path": "src/model/managed.zig",
              "source_line": 484,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L484",
              "doc": {
                "summary": "Verifies that the named model is installed and fits in the given VRAM budget.",
                "description": [
                  "Returns `error.UnknownManagedModel` if `model_id` is not in the catalog, or `error.ModelNotInstalled` if the GGUF file is absent from the local cache."
                ],
                "params": [
                  {
                    "name": "model_id",
                    "description": "Catalog model identifier to check."
                  },
                  {
                    "name": "vram_budget_bytes",
                    "description": "Available VRAM in bytes on the target device."
                  },
                  {
                    "name": "allocator",
                    "description": "Forwarded to `describeFit` for path and manifest I/O."
                  }
                ],
                "returns": "`ModelFit` describing the exact VRAM requirement and fit state.",
                "notes": [],
                "raw": "Verifies that the named model is installed and fits in the given VRAM budget.\n\nReturns `error.UnknownManagedModel` if `model_id` is not in the catalog, or\n`error.ModelNotInstalled` if the GGUF file is absent from the local cache."
              },
              "members": []
            },
            {
              "name": "removeInstalledModel",
              "qualified_name": "removeInstalledModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn removeInstalledModel(model_id: []const u8, allocator: std.mem.Allocator) !RemoveInstalledModelResult",
              "anchor": "remove-installed-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#remove-installed-model",
              "source_path": "src/model/managed.zig",
              "source_line": 491,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L491",
              "doc": {
                "summary": "Deletes an installed model's GGUF, manifest, and (if empty) its directory.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Deletes an installed model's GGUF, manifest, and (if empty) its directory."
              },
              "members": []
            },
            {
              "name": "pullModel",
              "qualified_name": "pullModel",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn pullModel(entry: catalog.CatalogEntry, allocator: std.mem.Allocator, writer: anytype) !void",
              "anchor": "pull-model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#pull-model",
              "source_path": "src/model/managed.zig",
              "source_line": 503,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L503",
              "doc": {
                "summary": "Downloads and installs a model from the catalog, verifying its sha256 checksum.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Downloads and installs a model from the catalog, verifying its sha256 checksum."
              },
              "members": []
            },
            {
              "name": "pullModelWithObserver",
              "qualified_name": "pullModelWithObserver",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn pullModelWithObserver( entry: catalog.CatalogEntry, allocator: std.mem.Allocator, writer: anytype, observer: ?*const DownloadObserver, ) !void",
              "anchor": "pull-model-with-observer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#pull-model-with-observer",
              "source_path": "src/model/managed.zig",
              "source_line": 516,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L516",
              "doc": {
                "summary": "Downloads and installs a model, reporting progress via an optional observer.",
                "description": [
                  "If the model is already installed and its sha256 matches the catalog, the function returns immediately without re-downloading. A `.partial` staging file is used so an interrupted download does not corrupt the cache."
                ],
                "params": [
                  {
                    "name": "entry",
                    "description": "Catalog entry that supplies the download URL and expected sha256."
                  },
                  {
                    "name": "allocator",
                    "description": "Used for HTTP client, path construction, and temporary buffers."
                  },
                  {
                    "name": "writer",
                    "description": "Receives human-readable status lines and the download progress bar."
                  },
                  {
                    "name": "observer",
                    "description": "Optional lifecycle callbacks for programmatic progress tracking; pass null to skip."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Downloads and installs a model, reporting progress via an optional observer.\n\nIf the model is already installed and its sha256 matches the catalog, the\nfunction returns immediately without re-downloading. A `.partial` staging\nfile is used so an interrupted download does not corrupt the cache."
              },
              "members": []
            },
            {
              "name": "bytesToGiB",
              "qualified_name": "bytesToGiB",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn bytesToGiB(bytes: u64) f64",
              "anchor": "bytes-to-gi-b",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/managed/#bytes-to-gi-b",
              "source_path": "src/model/managed.zig",
              "source_line": 682,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/model/managed.zig#L682",
              "doc": {
                "summary": "Converts a byte count to gibibytes (GiB) as a floating-point value.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Converts a byte count to gibibytes (GiB) as a floating-point value."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "model-manager",
          "title": "Model Manager",
          "section": "Managed Models",
          "summary": "Managed active-model runtime state for the HTTP server and CLI startup.",
          "overview": [
            "ZINC still loads one model into memory at a time. This manager keeps the current engine/tokenizer/model bundle together and handles serialized swaps."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/",
          "source_path": "src/server/model_manager.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L20",
          "counts": {
            "code_lines": 686,
            "exports": 5,
            "methods": 12,
            "symbols": 17
          },
          "symbols": [
            {
              "name": "LoadSpec",
              "qualified_name": "LoadSpec",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadSpec = struct",
              "anchor": "load-spec",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#load-spec",
              "source_path": "src/server/model_manager.zig",
              "source_line": 20,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L20",
              "doc": {
                "summary": "Describes which model to load: a filesystem path, an optional managed-catalog ID, and an optional context-length override.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Describes which model to load: a filesystem path, an optional managed-catalog ID, and an optional context-length override."
              },
              "members": []
            },
            {
              "name": "ModelSummary",
              "qualified_name": "ModelSummary",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelSummary = struct",
              "anchor": "model-summary",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-summary",
              "source_path": "src/server/model_manager.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L27",
              "doc": {
                "summary": "Flat representation of a catalog model for JSON serialization to API clients.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Flat representation of a catalog model for JSON serialization to API clients."
              },
              "members": []
            },
            {
              "name": "ModelCatalogView",
              "qualified_name": "ModelCatalogView",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelCatalogView = struct",
              "anchor": "model-catalog-view",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-catalog-view",
              "source_path": "src/server/model_manager.zig",
              "source_line": 56,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L56",
              "doc": {
                "summary": "Snapshot of the full model catalog annotated with the current GPU profile.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Snapshot of the full model catalog annotated with the current GPU profile."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "ModelCatalogView.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ModelCatalogView, allocator: std.mem.Allocator) void",
                  "anchor": "model-catalog-view-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-catalog-view-deinit",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 61,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L61",
                  "doc": {
                    "summary": "Frees the owned summary slice.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Frees the owned summary slice."
                  }
                }
              ]
            },
            {
              "name": "LoadedResources",
              "qualified_name": "LoadedResources",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadedResources = struct",
              "anchor": "loaded-resources",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#loaded-resources",
              "source_path": "src/server/model_manager.zig",
              "source_line": 68,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L68",
              "doc": {
                "summary": "Bundle of model, tokenizer, and inference engine that represents a fully loaded model.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Bundle of model, tokenizer, and inference engine that represents a fully loaded model."
              },
              "members": []
            },
            {
              "name": "ModelManager",
              "qualified_name": "ModelManager",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelManager = struct",
              "anchor": "model-manager",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager",
              "source_path": "src/server/model_manager.zig",
              "source_line": 95,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L95",
              "doc": {
                "summary": "Thread-safe owner of the currently active model, providing load, swap, and catalog queries.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Thread-safe owner of the currently active model, providing load, swap, and catalog queries."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ModelManager.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( spec: LoadSpec, instance: *const Instance, gpu_config_value: gpu_detect.GpuConfig, shader_dir: []const u8, allocator: std.mem.Allocator, ) !ModelManager",
                  "anchor": "model-manager-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-init",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 122,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L122",
                  "doc": {
                    "summary": "Creates a manager and immediately loads the model described by `spec`.",
                    "description": [
                      "Acquires the per-device GPU process lock before loading. or an error if loading fails."
                    ],
                    "params": [
                      {
                        "name": "spec",
                        "description": "Path, optional catalog ID, and optional context-length override for the model to load."
                      },
                      {
                        "name": "instance",
                        "description": "Vulkan instance that owns the selected GPU device."
                      },
                      {
                        "name": "gpu_config_value",
                        "description": "Detected GPU capabilities used for shader selection and catalog filtering."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Filesystem path to the directory containing compiled SPIR-V shaders."
                      },
                      {
                        "name": "allocator",
                        "description": "Used for all heap allocations owned by this manager."
                      }
                    ],
                    "returns": "An initialised `ModelManager` with `current` pointing to the loaded resources,",
                    "notes": [],
                    "raw": "Creates a manager and immediately loads the model described by `spec`.\nAcquires the per-device GPU process lock before loading.\nor an error if loading fails."
                  }
                },
                {
                  "name": "initEmpty",
                  "qualified_name": "ModelManager.initEmpty",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initEmpty( instance: *const Instance, gpu_config_value: gpu_detect.GpuConfig, shader_dir: []const u8, requested_context_length: ?u32, allocator: std.mem.Allocator, ) ModelManager",
                  "anchor": "model-manager-init-empty",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-init-empty",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 152,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L152",
                  "doc": {
                    "summary": "Creates a manager with no model loaded; the server starts idle and the GPU lock is not held.",
                    "description": [],
                    "params": [
                      {
                        "name": "instance",
                        "description": "Vulkan instance that owns the selected GPU device."
                      },
                      {
                        "name": "gpu_config_value",
                        "description": "Detected GPU capabilities used for catalog filtering."
                      },
                      {
                        "name": "shader_dir",
                        "description": "Filesystem path to the directory containing compiled SPIR-V shaders."
                      },
                      {
                        "name": "requested_context_length",
                        "description": "Optional token-count override applied when a model is later activated."
                      },
                      {
                        "name": "allocator",
                        "description": "Used for all heap allocations owned by this manager."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Creates a manager with no model loaded; the server starts idle and the GPU lock is not held."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ModelManager.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ModelManager) void",
                  "anchor": "model-manager-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-deinit",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 171,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L171",
                  "doc": {
                    "summary": "Tears down the loaded model (if any) and releases all owned resources.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Tears down the loaded model (if any) and releases all owned resources."
                  }
                },
                {
                  "name": "currentResources",
                  "qualified_name": "ModelManager.currentResources",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn currentResources(self: *ModelManager) ?*LoadedResources",
                  "anchor": "model-manager-current-resources",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-current-resources",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 182,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L182",
                  "doc": {
                    "summary": "Returns a pointer to the active model resources, or null if none is loaded.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Returns a pointer to the active model resources, or null if none is loaded."
                  }
                },
                {
                  "name": "activeDisplayName",
                  "qualified_name": "ModelManager.activeDisplayName",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activeDisplayName(self: *ModelManager) []const u8",
                  "anchor": "model-manager-active-display-name",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-active-display-name",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 187,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L187",
                  "doc": {
                    "summary": "Returns the human-readable name of the active model, or `\"none\"`.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Returns the human-readable name of the active model, or `\"none\"`."
                  }
                },
                {
                  "name": "catalogProfile",
                  "qualified_name": "ModelManager.catalogProfile",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn catalogProfile(self: *const ModelManager) []const u8",
                  "anchor": "model-manager-catalog-profile",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-catalog-profile",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 194,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L194",
                  "doc": {
                    "summary": "Returns the catalog profile string for the detected GPU (e.g.",
                    "description": [
                      "`\"amd-rdna4-32gb\"`)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Returns the catalog profile string for the detected GPU (e.g. `\"amd-rdna4-32gb\"`)."
                  }
                },
                {
                  "name": "currentMemoryUsage",
                  "qualified_name": "ModelManager.currentMemoryUsage",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn currentMemoryUsage(self: *ModelManager) MemoryUsage",
                  "anchor": "model-manager-current-memory-usage",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-current-memory-usage",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 224,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L224",
                  "doc": {
                    "summary": "Snapshots the VRAM usage of the active model, or returns zeroes with the full VRAM budget in `device_local_budget_bytes` if idle.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Snapshots the VRAM usage of the active model, or returns zeroes with the full VRAM budget in `device_local_budget_bytes` if idle."
                  }
                },
                {
                  "name": "collectCatalogView",
                  "qualified_name": "ModelManager.collectCatalogView",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn collectCatalogView(self: *ModelManager, allocator: std.mem.Allocator, include_all: bool) !ModelCatalogView",
                  "anchor": "model-manager-collect-catalog-view",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-collect-catalog-view",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 251,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L251",
                  "doc": {
                    "summary": "Builds a catalog snapshot with install/active/fit status for every entry.",
                    "description": [
                      "When `include_all` is false, entries unsupported on the current GPU are excluded."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Builds a catalog snapshot with install/active/fit status for every entry.\nWhen `include_all` is false, entries unsupported on the current GPU are excluded."
                  }
                },
                {
                  "name": "supportsManagedEntry",
                  "qualified_name": "ModelManager.supportsManagedEntry",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn supportsManagedEntry(self: *ModelManager, entry: catalog_mod.CatalogEntry, allocator: std.mem.Allocator) bool",
                  "anchor": "model-manager-supports-managed-entry",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-supports-managed-entry",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 348,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L348",
                  "doc": {
                    "summary": "Reports whether a catalog entry is both GPU-architecture-compatible and fits within the current VRAM budget.",
                    "description": [],
                    "params": [
                      {
                        "name": "entry",
                        "description": "The catalog entry to evaluate."
                      },
                      {
                        "name": "allocator",
                        "description": "Used for temporary allocations during fit computation; no long-lived allocation is made."
                      }
                    ],
                    "returns": "`true` when the entry matches the detected GPU profile and `describeFit` reports it fits.",
                    "notes": [],
                    "raw": "Reports whether a catalog entry is both GPU-architecture-compatible and fits within the current VRAM budget."
                  }
                },
                {
                  "name": "activateManagedModel",
                  "qualified_name": "ModelManager.activateManagedModel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activateManagedModel(self: *ModelManager, model_id: []const u8, persist_active: bool, force: bool) !void",
                  "anchor": "model-manager-activate-managed-model",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-activate-managed-model",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 373,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L373",
                  "doc": {
                    "summary": "Loads and activates a managed catalog model, replacing any currently loaded model.",
                    "description": [
                      "If the requested model is already active the function returns immediately (optionally persisting the selection). The GPU process lock is acquired if not already held. survives process restarts. detected GPU is rejected with `error.ModelUnsupportedOnThisGpu`; when true, activation proceeds on the untested profile with only a logged warning. `error.ModelUnsupportedOnThisGpu` if the entry is not validated on this GPU and `force` is false, `error.ModelNotInstalled` if the weights file is absent, or `error.ModelDoesNotFit` if the model exceeds the VRAM budget."
                    ],
                    "params": [
                      {
                        "name": "model_id",
                        "description": "Catalog entry ID to activate; must be installed on disk."
                      },
                      {
                        "name": "persist_active",
                        "description": "When true, writes the selection to the active-model file so it"
                      },
                      {
                        "name": "force",
                        "description": "When false, an entry whose tested profiles do not include the"
                      }
                    ],
                    "returns": "`error.UnknownManagedModel` if the ID is not in the catalog,",
                    "notes": [
                      "Caller must hold the shared generation lock before calling this function."
                    ],
                    "raw": "Loads and activates a managed catalog model, replacing any currently loaded model.\nIf the requested model is already active the function returns immediately (optionally\npersisting the selection). The GPU process lock is acquired if not already held.\nsurvives process restarts.\ndetected GPU is rejected with `error.ModelUnsupportedOnThisGpu`; when true,\nactivation proceeds on the untested profile with only a logged warning.\n`error.ModelUnsupportedOnThisGpu` if the entry is not validated on this GPU\nand `force` is false, `error.ModelNotInstalled` if the weights file is\nabsent, or `error.ModelDoesNotFit` if the model exceeds the VRAM budget."
                  }
                },
                {
                  "name": "removeManagedModel",
                  "qualified_name": "ModelManager.removeManagedModel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn removeManagedModel(self: *ModelManager, model_id: []const u8, force: bool) !RemoveResult",
                  "anchor": "model-manager-remove-managed-model",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager/#model-manager-remove-managed-model",
                  "source_path": "src/server/model_manager.zig",
                  "source_line": 438,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager.zig#L438",
                  "doc": {
                    "summary": "Uninstalls a managed model from disk and, if it is currently loaded, optionally evicts it from the GPU.",
                    "description": [
                      "active. When `true`, the model is unloaded from the GPU before deletion. active-selection file was updated."
                    ],
                    "params": [
                      {
                        "name": "model_id",
                        "description": "Catalog entry ID of the model to remove."
                      },
                      {
                        "name": "force",
                        "description": "When `false`, returns `error.ModelLoadedInGpu` if the model is currently"
                      }
                    ],
                    "returns": "A `RemoveResult` describing whether the GPU was cleared and whether the",
                    "notes": [
                      "Caller must hold the shared generation lock before calling this function."
                    ],
                    "raw": "Uninstalls a managed model from disk and, if it is currently loaded, optionally evicts it from the GPU.\nactive. When `true`, the model is unloaded from the GPU before deletion.\nactive-selection file was updated."
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "slug": "scheduler",
      "title": "Scheduler",
      "description": "Continuous batching scheduler, paged KV cache management, and request lifecycle tracking for concurrent inference serving.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#scheduler",
      "module_count": 3,
      "symbol_count": 32,
      "modules": [
        {
          "slug": "kv-cache",
          "title": "KV Cache",
          "section": "Scheduler",
          "summary": "Paged KV cache manager for concurrent request serving.",
          "overview": [
            "Manages a pool of fixed-size pages that are allocated per-request and freed on completion or cancellation. Each page maps to a contiguous region of the GPU KV cache buffer, giving each request non-overlapping token storage."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/",
          "source_path": "src/scheduler/kv_cache.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L13",
          "counts": {
            "code_lines": 187,
            "exports": 2,
            "methods": 7,
            "symbols": 9
          },
          "symbols": [
            {
              "name": "KvPage",
              "qualified_name": "KvPage",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KvPage = struct",
              "anchor": "kv-page",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page",
              "source_path": "src/scheduler/kv_cache.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L13",
              "doc": {
                "summary": "A single page in the KV cache pool.",
                "description": [
                  "Each page maps to a contiguous region of the GPU KV buffer."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A single page in the KV cache pool.\nEach page maps to a contiguous region of the GPU KV buffer."
              },
              "members": []
            },
            {
              "name": "KvPagePool",
              "qualified_name": "KvPagePool",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const KvPagePool = struct",
              "anchor": "kv-page-pool",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool",
              "source_path": "src/scheduler/kv_cache.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L26",
              "doc": {
                "summary": "Pool-based allocator for KV cache pages.",
                "description": [
                  "Tracks which pages are free and which are owned by active requests."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Pool-based allocator for KV cache pages.\nTracks which pages are free and which are owned by active requests."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "KvPagePool.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, total_pages: u32, page_size: u32) !KvPagePool",
                  "anchor": "kv-page-pool-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-init",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 43,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L43",
                  "doc": {
                    "summary": "Initialize a page pool with the given number of pages and tokens per page.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator for the page array and free list."
                      },
                      {
                        "name": "total_pages",
                        "description": "Number of pages to create."
                      },
                      {
                        "name": "page_size",
                        "description": "Number of tokens each page can hold."
                      }
                    ],
                    "returns": "A KvPagePool with all pages initially free.",
                    "notes": [],
                    "raw": "Initialize a page pool with the given number of pages and tokens per page."
                  }
                },
                {
                  "name": "allocPages",
                  "qualified_name": "KvPagePool.allocPages",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn allocPages(self: *KvPagePool, request_id: u64, count: u32) ![]u32",
                  "anchor": "kv-page-pool-alloc-pages",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-alloc-pages",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L72",
                  "doc": {
                    "summary": "Allocate `count` pages for a request and stamp them with `request_id`.",
                    "description": [],
                    "params": [
                      {
                        "name": "request_id",
                        "description": "Owner request ID recorded on each allocated page."
                      },
                      {
                        "name": "count",
                        "description": "Number of pages to allocate."
                      }
                    ],
                    "returns": "Slice of allocated page IDs; caller must free it with the pool's allocator.",
                    "notes": [
                      "Returns error.KvCacheExhausted if fewer than `count` free pages remain."
                    ],
                    "raw": "Allocate `count` pages for a request and stamp them with `request_id`."
                  }
                },
                {
                  "name": "freePages",
                  "qualified_name": "KvPagePool.freePages",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn freePages(self: *KvPagePool, request_id: u64) void",
                  "anchor": "kv-page-pool-free-pages",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-free-pages",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 87,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L87",
                  "doc": {
                    "summary": "Free all pages owned by a request, returning them to the free list.",
                    "description": [
                      "Performs a linear scan over all pages; O(total_pages)."
                    ],
                    "params": [
                      {
                        "name": "request_id",
                        "description": "Request whose pages should be freed."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Free all pages owned by a request, returning them to the free list.\nPerforms a linear scan over all pages; O(total_pages)."
                  }
                },
                {
                  "name": "positionBase",
                  "qualified_name": "KvPagePool.positionBase",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn positionBase(self: *const KvPagePool, page_ids: []const u32) u32",
                  "anchor": "kv-page-pool-position-base",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-position-base",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 102,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L102",
                  "doc": {
                    "summary": "Return the token position base for a request's first allocated page.",
                    "description": [
                      "Computed as `page_ids[0] * page_size`, which guarantees non-overlapping token storage across requests since each page_id maps to a disjoint range."
                    ],
                    "params": [
                      {
                        "name": "page_ids",
                        "description": "Allocated page IDs for the request (must be non-empty to get a meaningful result)."
                      }
                    ],
                    "returns": "Token index of the first token slot owned by this request, or 0 if `page_ids` is empty.",
                    "notes": [],
                    "raw": "Return the token position base for a request's first allocated page.\nComputed as `page_ids[0] * page_size`, which guarantees non-overlapping\ntoken storage across requests since each page_id maps to a disjoint range."
                  }
                },
                {
                  "name": "maxContext",
                  "qualified_name": "KvPagePool.maxContext",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxContext(self: *const KvPagePool, page_count: u32) u32",
                  "anchor": "kv-page-pool-max-context",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-max-context",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 110,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L110",
                  "doc": {
                    "summary": "Maximum context length (in tokens) that fits in `page_count` allocated pages.",
                    "description": [],
                    "params": [
                      {
                        "name": "page_count",
                        "description": "Number of pages allocated to the request."
                      }
                    ],
                    "returns": "`page_count * page_size` — the token capacity for those pages.",
                    "notes": [],
                    "raw": "Maximum context length (in tokens) that fits in `page_count` allocated pages."
                  }
                },
                {
                  "name": "freeCount",
                  "qualified_name": "KvPagePool.freeCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn freeCount(self: *const KvPagePool) u32",
                  "anchor": "kv-page-pool-free-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-free-count",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 116,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L116",
                  "doc": {
                    "summary": "Number of free pages currently available for allocation.",
                    "description": [],
                    "params": [],
                    "returns": "Count of unallocated pages remaining in the pool.",
                    "notes": [],
                    "raw": "Number of free pages currently available for allocation."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "KvPagePool.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *KvPagePool) void",
                  "anchor": "kv-page-pool-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/kv-cache/#kv-page-pool-deinit",
                  "source_path": "src/scheduler/kv_cache.zig",
                  "source_line": 121,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/kv_cache.zig#L121",
                  "doc": {
                    "summary": "Release the page array and free list back to the allocator.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the page array and free list back to the allocator."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "request",
          "title": "Request",
          "section": "Scheduler",
          "summary": "Request lifecycle management for concurrent inference serving.",
          "overview": [
            "Each incoming API request maps to a Request that tracks its state through prefill, decode, and completion phases."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/",
          "source_path": "src/scheduler/request.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L12",
          "counts": {
            "code_lines": 191,
            "exports": 3,
            "methods": 5,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "RequestState",
              "qualified_name": "RequestState",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const RequestState = enum",
              "anchor": "request-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-state",
              "source_path": "src/scheduler/request.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L12",
              "doc": {
                "summary": "Request processing state machine.",
                "description": [
                  "Valid transitions: pending → prefilling → decoding → completed, with cancelled reachable from any active state and failed reachable from prefilling or decoding."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Request processing state machine.\nValid transitions: pending → prefilling → decoding → completed,\nwith cancelled reachable from any active state and failed reachable from prefilling or decoding."
              },
              "members": []
            },
            {
              "name": "GenerationParams",
              "qualified_name": "GenerationParams",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const GenerationParams = struct",
              "anchor": "generation-params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#generation-params",
              "source_path": "src/scheduler/request.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L28",
              "doc": {
                "summary": "Generation parameters from the API request.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Generation parameters from the API request."
              },
              "members": []
            },
            {
              "name": "Request",
              "qualified_name": "Request",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Request = struct",
              "anchor": "request",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request",
              "source_path": "src/scheduler/request.zig",
              "source_line": 44,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L44",
              "doc": {
                "summary": "A single inference request with its lifecycle state.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A single inference request with its lifecycle state."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Request.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, id: u64, prompt_tokens: []const u32, params: GenerationParams) Request",
                  "anchor": "request-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-init",
                  "source_path": "src/scheduler/request.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L72",
                  "doc": {
                    "summary": "Create a new request in the pending state with the given prompt and parameters.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator for the generated token buffer."
                      },
                      {
                        "name": "id",
                        "description": "Unique request identifier."
                      },
                      {
                        "name": "prompt_tokens",
                        "description": "Tokenized prompt (owned by the caller)."
                      },
                      {
                        "name": "params",
                        "description": "Generation parameters (max_tokens, temperature, etc.)."
                      }
                    ],
                    "returns": "A Request ready to be submitted to the scheduler.",
                    "notes": [],
                    "raw": "Create a new request in the pending state with the given prompt and parameters."
                  }
                },
                {
                  "name": "transition",
                  "qualified_name": "Request.transition",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn transition(self: *Request, new_state: RequestState) !void",
                  "anchor": "request-transition",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-transition",
                  "source_path": "src/scheduler/request.zig",
                  "source_line": 90,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L90",
                  "doc": {
                    "summary": "Advance the request through the state machine.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Request to transition."
                      },
                      {
                        "name": "new_state",
                        "description": "Target state (must be a valid successor of the current state)."
                      }
                    ],
                    "returns": "error.InvalidTransition if the transition is not allowed by the state machine.",
                    "notes": [],
                    "raw": "Advance the request through the state machine."
                  }
                },
                {
                  "name": "appendToken",
                  "qualified_name": "Request.appendToken",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn appendToken(self: *Request, token: u32) !void",
                  "anchor": "request-append-token",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-append-token",
                  "source_path": "src/scheduler/request.zig",
                  "source_line": 104,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L104",
                  "doc": {
                    "summary": "Append a generated token and record the first-token timestamp if unset.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Request to append to."
                      },
                      {
                        "name": "token",
                        "description": "Generated token ID to add."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Append a generated token and record the first-token timestamp if unset."
                  }
                },
                {
                  "name": "shouldStop",
                  "qualified_name": "Request.shouldStop",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn shouldStop(self: *const Request, eos_token_id: u32) bool",
                  "anchor": "request-should-stop",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-should-stop",
                  "source_path": "src/scheduler/request.zig",
                  "source_line": 115,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L115",
                  "doc": {
                    "summary": "Check if generation should stop (max_tokens reached or EOS token emitted).",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Request to check."
                      },
                      {
                        "name": "eos_token_id",
                        "description": "End-of-sequence token ID."
                      }
                    ],
                    "returns": "True if generation should stop.",
                    "notes": [],
                    "raw": "Check if generation should stop (max_tokens reached or EOS token emitted)."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Request.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Request) void",
                  "anchor": "request-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/request/#request-deinit",
                  "source_path": "src/scheduler/request.zig",
                  "source_line": 126,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/request.zig#L126",
                  "doc": {
                    "summary": "Release the generated token buffer owned by this request.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Request to tear down."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Release the generated token buffer owned by this request."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "scheduler",
          "title": "Scheduler",
          "section": "Scheduler",
          "summary": "Continuous-batching scheduler groundwork for concurrent inference requests.",
          "overview": [
            "Today this module owns request slot accounting and state collection only. The HTTP serving hot path still serializes generation behind ServerState.generation_mutex; the batched prefill/decode dispatch loop is not wired yet."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/",
          "source_path": "src/scheduler/scheduler.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L16",
          "counts": {
            "code_lines": 380,
            "exports": 1,
            "methods": 14,
            "symbols": 15
          },
          "symbols": [
            {
              "name": "Scheduler",
              "qualified_name": "Scheduler",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Scheduler = struct",
              "anchor": "scheduler",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler",
              "source_path": "src/scheduler/scheduler.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L16",
              "doc": {
                "summary": "Fixed-capacity pool of request slots used to track concurrent inference requests.",
                "description": [
                  "Each slot holds at most one active `Request`; slots are reused once released."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Fixed-capacity pool of request slots used to track concurrent inference requests.\nEach slot holds at most one active `Request`; slots are reused once released."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Scheduler.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, max_parallel: u32) !Scheduler",
                  "anchor": "scheduler-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-init",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 37,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L37",
                  "doc": {
                    "summary": "Initialize the scheduler with a fixed number of concurrent request slots.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator for the slot array."
                      },
                      {
                        "name": "max_parallel",
                        "description": "Maximum number of concurrent requests."
                      }
                    ],
                    "returns": "A Scheduler with all slots initially empty.",
                    "notes": [],
                    "raw": "Initialize the scheduler with a fixed number of concurrent request slots."
                  }
                },
                {
                  "name": "enqueue",
                  "qualified_name": "Scheduler.enqueue",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn enqueue(self: *Scheduler, prompt_tokens: []const u32, params: GenerationParams) !u64",
                  "anchor": "scheduler-enqueue",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-enqueue",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 58,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L58",
                  "doc": {
                    "summary": "Enqueue a new request without assigning a slot (continuous-batching path).",
                    "description": [
                      "The request sits in `pending` (state `.pending`) until `admitNext` moves it into a free slot. Unlike `submit`, this never fails on a full slot array — arrivals queue and are admitted as slots free, which is what lets a running batch admit/evict sequences between decode steps."
                    ],
                    "params": [],
                    "returns": "The new request's unique id.",
                    "notes": [],
                    "raw": "Enqueue a new request without assigning a slot (continuous-batching path).\nThe request sits in `pending` (state `.pending`) until `admitNext` moves it\ninto a free slot. Unlike `submit`, this never fails on a full slot array —\narrivals queue and are admitted as slots free, which is what lets a running\nbatch admit/evict sequences between decode steps."
                  }
                },
                {
                  "name": "admitNext",
                  "qualified_name": "Scheduler.admitNext",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn admitNext(self: *Scheduler) !?u32",
                  "anchor": "scheduler-admit-next",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-admit-next",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 72,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L72",
                  "doc": {
                    "summary": "Admit the oldest pending request into the first free slot, if any.",
                    "description": [
                      "Moves it out of the `pending` queue, assigns `slot_id`, and transitions it to `.prefilling`. The caller then runs prefill for every slot reported by `pendingPrefill` and transitions those to `.decoding`."
                    ],
                    "params": [],
                    "returns": "The assigned slot index, or null if no pending request or no free slot.",
                    "notes": [],
                    "raw": "Admit the oldest pending request into the first free slot, if any.\nMoves it out of the `pending` queue, assigns `slot_id`, and transitions it\nto `.prefilling`. The caller then runs prefill for every slot reported by\n`pendingPrefill` and transitions those to `.decoding`."
                  }
                },
                {
                  "name": "hasFreeSlot",
                  "qualified_name": "Scheduler.hasFreeSlot",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn hasFreeSlot(self: *const Scheduler) bool",
                  "anchor": "scheduler-has-free-slot",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-has-free-slot",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 88,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L88",
                  "doc": {
                    "summary": "True if at least one slot is free.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "True if at least one slot is free."
                  }
                },
                {
                  "name": "isIdle",
                  "qualified_name": "Scheduler.isIdle",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isIdle(self: *const Scheduler) bool",
                  "anchor": "scheduler-is-idle",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-is-idle",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 96,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L96",
                  "doc": {
                    "summary": "True if there is no outstanding work: every slot empty and no waiters.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "True if there is no outstanding work: every slot empty and no waiters."
                  }
                },
                {
                  "name": "submit",
                  "qualified_name": "Scheduler.submit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn submit(self: *Scheduler, prompt_tokens: []const u32, params: GenerationParams) !u32",
                  "anchor": "scheduler-submit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-submit",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 106,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L106",
                  "doc": {
                    "summary": "Submit a new request and assign it to the first free slot.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to submit to."
                      },
                      {
                        "name": "prompt_tokens",
                        "description": "Tokenized prompt for the request."
                      },
                      {
                        "name": "params",
                        "description": "Generation parameters (max_tokens, temperature, etc.)."
                      }
                    ],
                    "returns": "The slot index that was assigned; pass this value to `release` when the request completes.",
                    "notes": [
                      "Returns `error.AllSlotsBusy` if every slot is occupied."
                    ],
                    "raw": "Submit a new request and assign it to the first free slot."
                  }
                },
                {
                  "name": "isFull",
                  "qualified_name": "Scheduler.isFull",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isFull(self: *const Scheduler) bool",
                  "anchor": "scheduler-is-full",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-is-full",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 125,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L125",
                  "doc": {
                    "summary": "Check if all slots are occupied.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to query."
                      }
                    ],
                    "returns": "True if every slot holds an active request.",
                    "notes": [],
                    "raw": "Check if all slots are occupied."
                  }
                },
                {
                  "name": "activeCount",
                  "qualified_name": "Scheduler.activeCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activeCount(self: *const Scheduler) u32",
                  "anchor": "scheduler-active-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-active-count",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 132,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L132",
                  "doc": {
                    "summary": "Get the number of active (non-null) requests.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to query."
                      }
                    ],
                    "returns": "Count of occupied slots.",
                    "notes": [],
                    "raw": "Get the number of active (non-null) requests."
                  }
                },
                {
                  "name": "transition",
                  "qualified_name": "Scheduler.transition",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn transition(self: *Scheduler, slot_id: u32, new_state: RequestState) !void",
                  "anchor": "scheduler-transition",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-transition",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 145,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L145",
                  "doc": {
                    "summary": "Transition a live slot through the request state machine.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to query."
                      },
                      {
                        "name": "slot_id",
                        "description": "Slot index to update."
                      },
                      {
                        "name": "new_state",
                        "description": "Target request state."
                      }
                    ],
                    "returns": "error.InvalidSlot if the slot is out of range or empty.",
                    "notes": [],
                    "raw": "Transition a live slot through the request state machine."
                  }
                },
                {
                  "name": "collectByState",
                  "qualified_name": "Scheduler.collectByState",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn collectByState(self: *const Scheduler, state: RequestState, out: []u32) []u32",
                  "anchor": "scheduler-collect-by-state",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-collect-by-state",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 159,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L159",
                  "doc": {
                    "summary": "Collect slot IDs whose request currently has `state`.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to query."
                      },
                      {
                        "name": "state",
                        "description": "Request state to match."
                      },
                      {
                        "name": "out",
                        "description": "Caller-owned scratch buffer for slot IDs."
                      }
                    ],
                    "returns": "A slice of `out` containing the collected slot IDs.",
                    "notes": [],
                    "raw": "Collect slot IDs whose request currently has `state`."
                  }
                },
                {
                  "name": "pendingPrefill",
                  "qualified_name": "Scheduler.pendingPrefill",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn pendingPrefill(self: *Scheduler) []u32",
                  "anchor": "scheduler-pending-prefill",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-pending-prefill",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 178,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L178",
                  "doc": {
                    "summary": "Slot IDs of requests in the `.prefilling` state (admitted, prompt not yet processed).",
                    "description": [
                      "The driver runs prefill for each, then transitions it to `.decoding`. activeDecoding call."
                    ],
                    "params": [],
                    "returns": "A slice into `self.scratch`, valid until the next pendingPrefill /",
                    "notes": [],
                    "raw": "Slot IDs of requests in the `.prefilling` state (admitted, prompt not yet\nprocessed). The driver runs prefill for each, then transitions it to\n`.decoding`.\nactiveDecoding call."
                  }
                },
                {
                  "name": "activeDecoding",
                  "qualified_name": "Scheduler.activeDecoding",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activeDecoding(self: *Scheduler) []u32",
                  "anchor": "scheduler-active-decoding",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-active-decoding",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 196,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L196",
                  "doc": {
                    "summary": "Slot IDs of requests in the `.decoding` state (the running decode batch).",
                    "description": [
                      "The driver gathers (token, position, slot) per id and issues ONE batched decode step over them. activeDecoding call."
                    ],
                    "params": [],
                    "returns": "A slice into `self.scratch`, valid until the next pendingPrefill /",
                    "notes": [],
                    "raw": "Slot IDs of requests in the `.decoding` state (the running decode batch).\nThe driver gathers (token, position, slot) per id and issues ONE batched\ndecode step over them.\nactiveDecoding call."
                  }
                },
                {
                  "name": "release",
                  "qualified_name": "Scheduler.release",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn release(self: *Scheduler, slot_id: u32) void",
                  "anchor": "scheduler-release",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-release",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 213,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L213",
                  "doc": {
                    "summary": "Release a completed or cancelled request's slot, freeing its resources.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to release from."
                      },
                      {
                        "name": "slot_id",
                        "description": "Slot index to free (the value returned by `submit`)."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Silently does nothing if `slot_id` is out of range or the slot is already empty."
                    ],
                    "raw": "Release a completed or cancelled request's slot, freeing its resources."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Scheduler.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Scheduler) void",
                  "anchor": "scheduler-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/scheduler/#scheduler-deinit",
                  "source_path": "src/scheduler/scheduler.zig",
                  "source_line": 225,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/scheduler/scheduler.zig#L225",
                  "doc": {
                    "summary": "Tear down all active and pending requests and free owned buffers.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Scheduler to destroy."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Tear down all active and pending requests and free owned buffers."
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "slug": "api-server",
      "title": "API Server",
      "description": "OpenAI-compatible HTTP server, route dispatch, SSE streaming, and session management for serving inference over the network.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#api-server",
      "module_count": 5,
      "symbol_count": 65,
      "modules": [
        {
          "slug": "http",
          "title": "Http",
          "section": "API Server",
          "summary": "Minimal HTTP/1.1 server for the OpenAI-compatible inference API.",
          "overview": [
            "Provides connection-level request parsing, JSON and SSE response helpers, and a TCP listener that hands off accepted connections to the route dispatcher."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/",
          "source_path": "src/server/http.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L18",
          "counts": {
            "code_lines": 334,
            "exports": 3,
            "methods": 12,
            "symbols": 15
          },
          "symbols": [
            {
              "name": "Connection",
              "qualified_name": "Connection",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Connection = struct",
              "anchor": "connection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection",
              "source_path": "src/server/http.zig",
              "source_line": 18,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L18",
              "doc": {
                "summary": "Active client connection with request/response capabilities.",
                "description": [
                  "Wraps a TCP stream and provides helpers for reading HTTP requests and writing JSON, error, and SSE responses."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Active client connection with request/response capabilities.\nWraps a TCP stream and provides helpers for reading HTTP requests\nand writing JSON, error, and SSE responses."
              },
              "members": [
                {
                  "name": "readRequest",
                  "qualified_name": "Connection.readRequest",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn readRequest(self: *Connection) !Request",
                  "anchor": "connection-read-request",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-read-request",
                  "source_path": "src/server/http.zig",
                  "source_line": 37,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L37",
                  "doc": {
                    "summary": "Read and parse an HTTP/1.1 request from the connection.",
                    "description": [
                      "Reads headers until `\\r\\n\\r\\n`, extracts method/path/Content-Length, then reads the remaining body bytes."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to read from."
                      }
                    ],
                    "returns": "Parsed request with method, path, and body.",
                    "notes": [],
                    "raw": "Read and parse an HTTP/1.1 request from the connection.\nReads headers until `\\r\\n\\r\\n`, extracts method/path/Content-Length,\nthen reads the remaining body bytes."
                  }
                },
                {
                  "name": "sendJson",
                  "qualified_name": "Connection.sendJson",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sendJson(self: *Connection, status: u16, body: []const u8) !void",
                  "anchor": "connection-send-json",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-send-json",
                  "source_path": "src/server/http.zig",
                  "source_line": 157,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L157",
                  "doc": {
                    "summary": "Send a JSON response with the given HTTP status code.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      },
                      {
                        "name": "status",
                        "description": "HTTP status code (200, 400, 404, etc.)."
                      },
                      {
                        "name": "body",
                        "description": "JSON-encoded response body."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Send a JSON response with the given HTTP status code."
                  }
                },
                {
                  "name": "sendError",
                  "qualified_name": "Connection.sendError",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sendError(self: *Connection, status: u16, err_type: []const u8, message: []const u8) !void",
                  "anchor": "connection-send-error",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-send-error",
                  "source_path": "src/server/http.zig",
                  "source_line": 180,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L180",
                  "doc": {
                    "summary": "Send an OpenAI-format JSON error response.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      },
                      {
                        "name": "status",
                        "description": "HTTP status code for the error."
                      },
                      {
                        "name": "err_type",
                        "description": "OpenAI error type string (e.g. \"invalid_request_error\")."
                      },
                      {
                        "name": "message",
                        "description": "Human-readable error message."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Send an OpenAI-format JSON error response."
                  }
                },
                {
                  "name": "sendSseStart",
                  "qualified_name": "Connection.sendSseStart",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn sendSseStart(self: *Connection) !void",
                  "anchor": "connection-send-sse-start",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-send-sse-start",
                  "source_path": "src/server/http.zig",
                  "source_line": 189,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L189",
                  "doc": {
                    "summary": "Send SSE streaming response headers with chunked transfer encoding.",
                    "description": [
                      "After this call, use writeSseEvent to send individual events."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Send SSE streaming response headers with chunked transfer encoding.\nAfter this call, use writeSseEvent to send individual events."
                  }
                },
                {
                  "name": "writeSseEvent",
                  "qualified_name": "Connection.writeSseEvent",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeSseEvent(self: *Connection, data: []const u8) !void",
                  "anchor": "connection-write-sse-event",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-write-sse-event",
                  "source_path": "src/server/http.zig",
                  "source_line": 197,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L197",
                  "doc": {
                    "summary": "Write a single SSE event as a chunked transfer-encoding frame.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      },
                      {
                        "name": "data",
                        "description": "Event payload (typically JSON), sent as `data: {payload}\\n\\n`."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Write a single SSE event as a chunked transfer-encoding frame."
                  }
                },
                {
                  "name": "writeSseComment",
                  "qualified_name": "Connection.writeSseComment",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeSseComment(self: *Connection, text: []const u8) !void",
                  "anchor": "connection-write-sse-comment",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-write-sse-comment",
                  "source_path": "src/server/http.zig",
                  "source_line": 217,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L217",
                  "doc": {
                    "summary": "Write a chunked SSE comment line (`: {text}\\n\\n`) to keep the connection alive.",
                    "description": [
                      "Useful when a client or intermediate proxy would time out on a quiet stream before the next model token is ready."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      },
                      {
                        "name": "text",
                        "description": "Comment payload sent verbatim after the `: ` prefix."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Write a chunked SSE comment line (`: {text}\\n\\n`) to keep the connection alive.\nUseful when a client or intermediate proxy would time out on a quiet\nstream before the next model token is ready."
                  }
                },
                {
                  "name": "writeSseDone",
                  "qualified_name": "Connection.writeSseDone",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn writeSseDone(self: *Connection) !void",
                  "anchor": "connection-write-sse-done",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-write-sse-done",
                  "source_path": "src/server/http.zig",
                  "source_line": 229,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L229",
                  "doc": {
                    "summary": "Write the final SSE `[DONE]` event and send the chunked transfer terminator.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to write to."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Write the final SSE `[DONE]` event and send the chunked transfer terminator."
                  }
                },
                {
                  "name": "isPeerClosed",
                  "qualified_name": "Connection.isPeerClosed",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn isPeerClosed(self: *Connection) bool",
                  "anchor": "connection-is-peer-closed",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-is-peer-closed",
                  "source_path": "src/server/http.zig",
                  "source_line": 251,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L251",
                  "doc": {
                    "summary": "Check whether the remote connection is definitively dead, to let a streaming decode loop bail out before the next token instead of discovering the same thing on the next write.",
                    "description": [
                      "This only reports `true` on an unambiguous signal: a TCP reset, refusal, or an already-disconnected socket. A zero-byte peek (the peer's write side reached EOF) is deliberately treated as \"not closed\": HTTP/1.1 clients commonly half-close the upload side right after sending the request body while still reading the response, so that signal cannot distinguish \"client hung up\" from \"compliant client, still receiving the SSE stream\". Bailing out on it would truncate valid streams for such clients — worse than the wasted decode time this function is meant to save. Only a write failure (`catch return` at each write-path call site) proves that case."
                    ],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active connection to inspect."
                      }
                    ],
                    "returns": "`true` only for a hard reset/refused/disconnected socket.",
                    "notes": [],
                    "raw": "Check whether the remote connection is definitively dead, to let a\nstreaming decode loop bail out before the next token instead of\ndiscovering the same thing on the next write.\n\nThis only reports `true` on an unambiguous signal: a TCP reset,\nrefusal, or an already-disconnected socket. A zero-byte peek (the\npeer's write side reached EOF) is deliberately treated as \"not\nclosed\": HTTP/1.1 clients commonly half-close the upload side right\nafter sending the request body while still reading the response, so\nthat signal cannot distinguish \"client hung up\" from \"compliant\nclient, still receiving the SSE stream\". Bailing out on it would\ntruncate valid streams for such clients — worse than the wasted\ndecode time this function is meant to save. Only a write failure\n(`catch return` at each write-path call site) proves that case."
                  }
                },
                {
                  "name": "close",
                  "qualified_name": "Connection.close",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn close(self: *Connection) void",
                  "anchor": "connection-close",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#connection-close",
                  "source_path": "src/server/http.zig",
                  "source_line": 269,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L269",
                  "doc": {
                    "summary": "Close the underlying TCP stream and free any heap-allocated overflow body from `readRequest`.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Connection to close."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Close the underlying TCP stream and free any heap-allocated overflow\nbody from `readRequest`."
                  }
                }
              ]
            },
            {
              "name": "Method",
              "qualified_name": "Method",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const Method = enum GET, POST, OPTIONS, UNKNOWN }",
              "anchor": "method",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#method",
              "source_path": "src/server/http.zig",
              "source_line": 277,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L277",
              "doc": {
                "summary": "HTTP request method parsed from the request line.",
                "description": [
                  "`UNKNOWN` is the fallback for any method not explicitly handled by the server."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "HTTP request method parsed from the request line.\n`UNKNOWN` is the fallback for any method not explicitly handled by the server."
              },
              "members": []
            },
            {
              "name": "Server",
              "qualified_name": "Server",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Server = struct",
              "anchor": "server",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#server",
              "source_path": "src/server/http.zig",
              "source_line": 292,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L292",
              "doc": {
                "summary": "HTTP server that binds and listens on a TCP port.",
                "description": [
                  "Accepts connections and wraps them in Connection structs for request handling."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "HTTP server that binds and listens on a TCP port.\nAccepts connections and wraps them in Connection structs for request handling."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "Server.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, port: u16) !Server",
                  "anchor": "server-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#server-init",
                  "source_path": "src/server/http.zig",
                  "source_line": 302,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L302",
                  "doc": {
                    "summary": "Bind to all interfaces on the given port and start listening.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator for connection resources."
                      },
                      {
                        "name": "port",
                        "description": "TCP port to listen on."
                      }
                    ],
                    "returns": "A Server ready to accept connections.",
                    "notes": [],
                    "raw": "Bind to all interfaces on the given port and start listening."
                  }
                },
                {
                  "name": "accept",
                  "qualified_name": "Server.accept",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn accept(self: *Server) !Connection",
                  "anchor": "server-accept",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#server-accept",
                  "source_path": "src/server/http.zig",
                  "source_line": 311,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L311",
                  "doc": {
                    "summary": "Block until a client connects, then return a Connection for that client.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Active server to accept on."
                      }
                    ],
                    "returns": "A new Connection wrapping the accepted TCP stream.",
                    "notes": [],
                    "raw": "Block until a client connects, then return a Connection for that client."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "Server.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *Server) void",
                  "anchor": "server-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/http/#server-deinit",
                  "source_path": "src/server/http.zig",
                  "source_line": 318,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/http.zig#L318",
                  "doc": {
                    "summary": "Stop listening and release the server socket.",
                    "description": [],
                    "params": [
                      {
                        "name": "self",
                        "description": "Server to tear down."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Stop listening and release the server socket."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "model-manager-metal",
          "title": "Model Manager Metal",
          "section": "API Server",
          "summary": "Metal-backed active-model runtime state for the HTTP server.",
          "overview": [
            "The server uses this manager to load one Metal model at a time, track the tokenizer and runtime allocations that belong to it, and project fit/status information back into the OpenAI-compatible model-management endpoints."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/",
          "source_path": "src/server/model_manager_metal.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L22",
          "counts": {
            "code_lines": 594,
            "exports": 5,
            "methods": 12,
            "symbols": 17
          },
          "symbols": [
            {
              "name": "LoadSpec",
              "qualified_name": "LoadSpec",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadSpec = struct",
              "anchor": "load-spec",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#load-spec",
              "source_path": "src/server/model_manager_metal.zig",
              "source_line": 22,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L22",
              "doc": {
                "summary": "Identifies a model to load: a GGUF file path and optional managed-catalog id.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Identifies a model to load: a GGUF file path and optional managed-catalog id."
              },
              "members": []
            },
            {
              "name": "ModelSummary",
              "qualified_name": "ModelSummary",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelSummary = struct",
              "anchor": "model-summary",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-summary",
              "source_path": "src/server/model_manager_metal.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L29",
              "doc": {
                "summary": "Compact view of one catalog entry for the HTTP `/v1/models` response.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Compact view of one catalog entry for the HTTP `/v1/models` response."
              },
              "members": []
            },
            {
              "name": "ModelCatalogView",
              "qualified_name": "ModelCatalogView",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelCatalogView = struct",
              "anchor": "model-catalog-view",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-catalog-view",
              "source_path": "src/server/model_manager_metal.zig",
              "source_line": 58,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L58",
              "doc": {
                "summary": "Snapshot of the full model catalog, filtered by the current GPU profile.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Snapshot of the full model catalog, filtered by the current GPU profile."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "ModelCatalogView.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ModelCatalogView, allocator: std.mem.Allocator) void",
                  "anchor": "model-catalog-view-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-catalog-view-deinit",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 63,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L63",
                  "doc": {
                    "summary": "Free the owned catalog summary slice.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Free the owned catalog summary slice."
                  }
                }
              ]
            },
            {
              "name": "LoadedResources",
              "qualified_name": "LoadedResources",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const LoadedResources = struct",
              "anchor": "loaded-resources",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#loaded-resources",
              "source_path": "src/server/model_manager_metal.zig",
              "source_line": 70,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L70",
              "doc": {
                "summary": "All GPU and host resources for a loaded model: weights, tokenizer, and inference engine.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "All GPU and host resources for a loaded model: weights, tokenizer, and inference engine."
              },
              "members": []
            },
            {
              "name": "ModelManager",
              "qualified_name": "ModelManager",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ModelManager = struct",
              "anchor": "model-manager",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager",
              "source_path": "src/server/model_manager_metal.zig",
              "source_line": 98,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L98",
              "doc": {
                "summary": "Thread-safe manager for the currently active model on the Metal backend.",
                "description": [
                  "Handles loading, hot-swapping, catalog queries, and VRAM budget enforcement."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Thread-safe manager for the currently active model on the Metal backend.\nHandles loading, hot-swapping, catalog queries, and VRAM budget enforcement."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ModelManager.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( spec: LoadSpec, device: *const MetalDevice, allocator: std.mem.Allocator, ) !ModelManager",
                  "anchor": "model-manager-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-init",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 145,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L145",
                  "doc": {
                    "summary": "Create a manager and eagerly load the model described by `spec`.",
                    "description": [
                      "Acquires the per-device GPU process lock before touching Metal resources."
                    ],
                    "params": [
                      {
                        "name": "spec",
                        "description": "Path, optional managed-catalog id, and optional context-length override."
                      },
                      {
                        "name": "device",
                        "description": "Metal device to load weights onto."
                      },
                      {
                        "name": "allocator",
                        "description": "Used for all heap allocations; must outlive the returned manager."
                      }
                    ],
                    "returns": "A fully initialised manager with a loaded model, or an error if loading fails.",
                    "notes": [],
                    "raw": "Create a manager and eagerly load the model described by `spec`.\n\nAcquires the per-device GPU process lock before touching Metal resources."
                  }
                },
                {
                  "name": "initEmpty",
                  "qualified_name": "ModelManager.initEmpty",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initEmpty( device: *const MetalDevice, requested_context_length: ?u32, allocator: std.mem.Allocator, ) ModelManager",
                  "anchor": "model-manager-init-empty",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-init-empty",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 171,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L171",
                  "doc": {
                    "summary": "Create an idle manager with no model currently loaded.",
                    "description": [
                      "The GPU process lock is not acquired until the first model is activated. `null` lets the memory planner auto-size the context window."
                    ],
                    "params": [
                      {
                        "name": "requested_context_length",
                        "description": "Token limit to apply when a model is later loaded;"
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Create an idle manager with no model currently loaded.\n\nThe GPU process lock is not acquired until the first model is activated.\n`null` lets the memory planner auto-size the context window."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ModelManager.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ModelManager) void",
                  "anchor": "model-manager-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-deinit",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 187,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L187",
                  "doc": {
                    "summary": "Tear down the active model, if any, and release the GPU process lock.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Tear down the active model, if any, and release the GPU process lock."
                  }
                },
                {
                  "name": "currentResources",
                  "qualified_name": "ModelManager.currentResources",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn currentResources(self: *ModelManager) ?*LoadedResources",
                  "anchor": "model-manager-current-resources",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-current-resources",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 198,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L198",
                  "doc": {
                    "summary": "Return the currently loaded resource bundle, or null when idle.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the currently loaded resource bundle, or null when idle."
                  }
                },
                {
                  "name": "activeDisplayName",
                  "qualified_name": "ModelManager.activeDisplayName",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activeDisplayName(self: *ModelManager) []const u8",
                  "anchor": "model-manager-active-display-name",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-active-display-name",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 203,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L203",
                  "doc": {
                    "summary": "Return the active model display name, or `\"none\"` when no model is loaded.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the active model display name, or `\"none\"` when no model is loaded."
                  }
                },
                {
                  "name": "catalogProfile",
                  "qualified_name": "ModelManager.catalogProfile",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn catalogProfile(self: *const ModelManager) []const u8",
                  "anchor": "model-manager-catalog-profile",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-catalog-profile",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 210,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L210",
                  "doc": {
                    "summary": "Return the catalog profile string used for the active Metal device.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return the catalog profile string used for the active Metal device."
                  }
                },
                {
                  "name": "currentMemoryUsage",
                  "qualified_name": "ModelManager.currentMemoryUsage",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn currentMemoryUsage(self: *ModelManager) MemoryUsage",
                  "anchor": "model-manager-current-memory-usage",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-current-memory-usage",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 215,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L215",
                  "doc": {
                    "summary": "Snapshot memory usage for the active model, or zeroes when idle.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Snapshot memory usage for the active model, or zeroes when idle."
                  }
                },
                {
                  "name": "collectCatalogView",
                  "qualified_name": "ModelManager.collectCatalogView",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn collectCatalogView(self: *ModelManager, allocator: std.mem.Allocator, include_all: bool) !ModelCatalogView",
                  "anchor": "model-manager-collect-catalog-view",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-collect-catalog-view",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 249,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L249",
                  "doc": {
                    "summary": "Build a catalog view annotated with install, fit, and active-model status.",
                    "description": [
                      "Entries are filtered to those that are supported on the current GPU profile and fit within the VRAM budget unless `include_all` is true. The currently-active model is always included even if its static VRAM estimate exceeds the live budget. Unrecognised loaded models (raw GGUF files with no catalog entry) appear as a synthetic entry with `managed = false`."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Used to allocate the returned `ModelCatalogView.data` slice; caller must call `deinit`."
                      },
                      {
                        "name": "include_all",
                        "description": "When true, unsupported and oversized entries are included in the result."
                      }
                    ],
                    "returns": "An owned `ModelCatalogView`; free with `ModelCatalogView.deinit`.",
                    "notes": [],
                    "raw": "Build a catalog view annotated with install, fit, and active-model status.\n\nEntries are filtered to those that are supported on the current GPU profile and fit within\nthe VRAM budget unless `include_all` is true.  The currently-active model is always included\neven if its static VRAM estimate exceeds the live budget.  Unrecognised loaded models\n(raw GGUF files with no catalog entry) appear as a synthetic entry with `managed = false`."
                  }
                },
                {
                  "name": "supportsManagedEntry",
                  "qualified_name": "ModelManager.supportsManagedEntry",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn supportsManagedEntry(self: *ModelManager, entry: catalog_mod.CatalogEntry, allocator: std.mem.Allocator) bool",
                  "anchor": "model-manager-supports-managed-entry",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-supports-managed-entry",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 341,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L341",
                  "doc": {
                    "summary": "Return whether a managed catalog entry is supported and fits on the active device.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Return whether a managed catalog entry is supported and fits on the active device."
                  }
                },
                {
                  "name": "activateManagedModel",
                  "qualified_name": "ModelManager.activateManagedModel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn activateManagedModel(self: *ModelManager, model_id: []const u8, persist_active: bool, force: bool) !void",
                  "anchor": "model-manager-activate-managed-model",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-activate-managed-model",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 359,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L359",
                  "doc": {
                    "summary": "Load the specified catalog model and make it the active inference target.",
                    "description": [
                      "Hot-swaps the previous model if one is loaded. Validates that the model is installed, supported on this GPU profile, and fits within the VRAM budget before touching Metal."
                    ],
                    "params": [
                      {
                        "name": "model_id",
                        "description": "Catalog identifier of the managed model to activate."
                      },
                      {
                        "name": "persist_active",
                        "description": "When true, writes the selection to the active-model config file."
                      }
                    ],
                    "returns": null,
                    "notes": [
                      "Caller must already hold the shared generation lock."
                    ],
                    "raw": "Load the specified catalog model and make it the active inference target.\n\nHot-swaps the previous model if one is loaded.  Validates that the model is installed,\nsupported on this GPU profile, and fits within the VRAM budget before touching Metal."
                  }
                },
                {
                  "name": "removeManagedModel",
                  "qualified_name": "ModelManager.removeManagedModel",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn removeManagedModel(self: *ModelManager, model_id: []const u8, force: bool) !RemoveResult",
                  "anchor": "model-manager-remove-managed-model",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-metal/#model-manager-remove-managed-model",
                  "source_path": "src/server/model_manager_metal.zig",
                  "source_line": 423,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_metal.zig#L423",
                  "doc": {
                    "summary": "Unload and delete a managed model from both GPU memory and the model store on disk.",
                    "description": [
                      "If the model is currently loaded and `force` is false, returns `error.ModelLoadedInGpu`. With `force` true the model is evicted from GPU memory before deletion."
                    ],
                    "params": [
                      {
                        "name": "model_id",
                        "description": "Catalog identifier of the model to remove."
                      },
                      {
                        "name": "force",
                        "description": "When true, evict the model from GPU memory even if it is active."
                      }
                    ],
                    "returns": "A `RemoveResult` describing what was unloaded and what was deleted.",
                    "notes": [
                      "Caller must already hold the shared generation lock."
                    ],
                    "raw": "Unload and delete a managed model from both GPU memory and the model store on disk.\n\nIf the model is currently loaded and `force` is false, returns `error.ModelLoadedInGpu`.\nWith `force` true the model is evicted from GPU memory before deletion."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "model-manager-runtime",
          "title": "Model Manager Runtime",
          "section": "API Server",
          "summary": "Backend-selected model manager for the HTTP server.",
          "overview": [
            "This thin shim keeps the HTTP server code importing one stable manager type while build-time backend selection decides whether that implementation comes from the Vulkan runtime or the Apple Silicon Metal runtime."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-runtime/",
          "source_path": "src/server/model_manager_runtime.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_runtime.zig#L15",
          "counts": {
            "code_lines": 7,
            "exports": 2,
            "methods": 0,
            "symbols": 2
          },
          "symbols": [
            {
              "name": "LoadSpec",
              "qualified_name": "LoadSpec",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const LoadSpec = impl.LoadSpec",
              "anchor": "load-spec",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-runtime/#load-spec",
              "source_path": "src/server/model_manager_runtime.zig",
              "source_line": 15,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_runtime.zig#L15",
              "doc": {
                "summary": "Specification describing which model to load: a filesystem path, an optional managed-catalog ID, and an optional context-length override.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Specification describing which model to load: a filesystem path, an optional managed-catalog ID, and an optional context-length override."
              },
              "members": []
            },
            {
              "name": "ModelManager",
              "qualified_name": "ModelManager",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ModelManager = impl.ModelManager",
              "anchor": "model-manager",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/model-manager-runtime/#model-manager",
              "source_path": "src/server/model_manager_runtime.zig",
              "source_line": 17,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/model_manager_runtime.zig#L17",
              "doc": {
                "summary": "Thread-safe manager for the currently active model and inference engine; handles loading, hot-swapping, catalog queries, and VRAM budget enforcement.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Thread-safe manager for the currently active model and inference engine; handles loading, hot-swapping, catalog queries, and VRAM budget enforcement."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "routes",
          "title": "Routes",
          "section": "API Server",
          "summary": "Route dispatcher and endpoint handlers for the OpenAI-compatible API.",
          "overview": [
            "Handles /v1/chat/completions, /v1/completions, /v1/models, /health, and a built-in chat UI. Supports both streaming (SSE) and non-streaming responses."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/",
          "source_path": "src/server/routes.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L28",
          "counts": {
            "code_lines": 4201,
            "exports": 3,
            "methods": 8,
            "symbols": 11
          },
          "symbols": [
            {
              "name": "toolCallingEnabled",
              "qualified_name": "toolCallingEnabled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn toolCallingEnabled() bool",
              "anchor": "tool-calling-enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#tool-calling-enabled",
              "source_path": "src/server/routes.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L28",
              "doc": {
                "summary": "Return true if OpenAI-compatible tool calling is enabled.",
                "description": [
                  "Default on. Set `ZINC_TOOL_CALLING=0` (or `false`) to opt out — useful as a kill switch for clients that misbehave when seeing the new `tool_calls` response shape, or for debugging."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Return true if OpenAI-compatible tool calling is enabled. Default on.\nSet `ZINC_TOOL_CALLING=0` (or `false`) to opt out — useful as a kill\nswitch for clients that misbehave when seeing the new `tool_calls`\nresponse shape, or for debugging."
              },
              "members": []
            },
            {
              "name": "ServerState",
              "qualified_name": "ServerState",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ServerState = struct",
              "anchor": "server-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state",
              "source_path": "src/server/routes.zig",
              "source_line": 165,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L165",
              "doc": {
                "summary": "Shared server state tracking active requests, context usage, and generation serialization.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Shared server state tracking active requests, context usage, and generation serialization."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ServerState.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(started_at: i64) ServerState",
                  "anchor": "server-state-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-init",
                  "source_path": "src/server/routes.zig",
                  "source_line": 177,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L177",
                  "doc": {
                    "summary": "Create a new server state anchored to the given UNIX timestamp.",
                    "description": [],
                    "params": [
                      {
                        "name": "started_at",
                        "description": "UNIX timestamp (seconds) of server startup, stored for uptime calculations."
                      }
                    ],
                    "returns": "Initialized `ServerState` with zeroed counters and an empty chat-reuse cache.",
                    "notes": [],
                    "raw": "Create a new server state anchored to the given UNIX timestamp."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ServerState.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ServerState) void",
                  "anchor": "server-state-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-deinit",
                  "source_path": "src/server/routes.zig",
                  "source_line": 185,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L185",
                  "doc": {
                    "summary": "Release owned resources (chat reuse cache).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release owned resources (chat reuse cache)."
                  }
                },
                {
                  "name": "uptimeSeconds",
                  "qualified_name": "ServerState.uptimeSeconds",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn uptimeSeconds(self: *const ServerState, now: i64) u64",
                  "anchor": "server-state-uptime-seconds",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-uptime-seconds",
                  "source_path": "src/server/routes.zig",
                  "source_line": 192,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L192",
                  "doc": {
                    "summary": "Return elapsed seconds since the server started.",
                    "description": [],
                    "params": [
                      {
                        "name": "now",
                        "description": "Current UNIX timestamp (seconds) to compare against `started_at`."
                      }
                    ],
                    "returns": "Non-negative elapsed seconds; clamped to 0 if `now` is before `started_at`.",
                    "notes": [],
                    "raw": "Return elapsed seconds since the server started."
                  }
                },
                {
                  "name": "snapshot",
                  "qualified_name": "ServerState.snapshot",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn snapshot(self: *const ServerState, now: i64) HealthSnapshot",
                  "anchor": "server-state-snapshot",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-snapshot",
                  "source_path": "src/server/routes.zig",
                  "source_line": 199,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L199",
                  "doc": {
                    "summary": "Atomically capture current request and context counters for the health endpoint.",
                    "description": [],
                    "params": [
                      {
                        "name": "now",
                        "description": "Current UNIX timestamp (seconds) used to compute uptime in the snapshot."
                      }
                    ],
                    "returns": "`HealthSnapshot` with monotonic reads of all live counters and computed uptime.",
                    "notes": [],
                    "raw": "Atomically capture current request and context counters for the health endpoint."
                  }
                },
                {
                  "name": "setActiveContextTokens",
                  "qualified_name": "ServerState.setActiveContextTokens",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn setActiveContextTokens(self: *ServerState, tokens: u32) void",
                  "anchor": "server-state-set-active-context-tokens",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-set-active-context-tokens",
                  "source_path": "src/server/routes.zig",
                  "source_line": 210,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L210",
                  "doc": {
                    "summary": "Update the active KV-cache token count reported by the health endpoint.",
                    "description": [],
                    "params": [
                      {
                        "name": "tokens",
                        "description": "Number of tokens currently occupying the KV cache."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Update the active KV-cache token count reported by the health endpoint."
                  }
                },
                {
                  "name": "clearActiveContext",
                  "qualified_name": "ServerState.clearActiveContext",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn clearActiveContext(self: *ServerState) void",
                  "anchor": "server-state-clear-active-context",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-clear-active-context",
                  "source_path": "src/server/routes.zig",
                  "source_line": 215,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L215",
                  "doc": {
                    "summary": "Reset the active context token count to zero.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Reset the active context token count to zero."
                  }
                },
                {
                  "name": "clearChatReuseCache",
                  "qualified_name": "ServerState.clearChatReuseCache",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn clearChatReuseCache(self: *ServerState) void",
                  "anchor": "server-state-clear-chat-reuse-cache",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-clear-chat-reuse-cache",
                  "source_path": "src/server/routes.zig",
                  "source_line": 220,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L220",
                  "doc": {
                    "summary": "Evict all entries from the chat prompt-reuse cache.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Evict all entries from the chat prompt-reuse cache."
                  }
                },
                {
                  "name": "clearChatReuseSession",
                  "qualified_name": "ServerState.clearChatReuseSession",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn clearChatReuseSession(self: *ServerState, session_id: []const u8) void",
                  "anchor": "server-state-clear-chat-reuse-session",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#server-state-clear-chat-reuse-session",
                  "source_path": "src/server/routes.zig",
                  "source_line": 226,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L226",
                  "doc": {
                    "summary": "Remove a single session from the chat prompt-reuse cache.",
                    "description": [],
                    "params": [
                      {
                        "name": "session_id",
                        "description": "Opaque session identifier matching the entry to evict."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Remove a single session from the chat prompt-reuse cache."
                  }
                }
              ]
            },
            {
              "name": "handleConnection",
              "qualified_name": "handleConnection",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn handleConnection( conn: *http.Connection, manager: *model_manager_mod.ModelManager, server_state: *ServerState, allocator: std.mem.Allocator, ) !void",
              "anchor": "handle-connection",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/routes/#handle-connection",
              "source_path": "src/server/routes.zig",
              "source_line": 369,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/routes.zig#L369",
              "doc": {
                "summary": "Handle one HTTP connection: parse request, dispatch to endpoint, send response.",
                "description": [],
                "params": [
                  {
                    "name": "conn",
                    "description": "Active client connection to read from and write to."
                  },
                  {
                    "name": "manager",
                    "description": "Model manager used to resolve the active model for inference."
                  },
                  {
                    "name": "server_state",
                    "description": "Shared server metrics and generation serialization lock."
                  },
                  {
                    "name": "allocator",
                    "description": "Allocator for per-request temporaries."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Handle one HTTP connection: parse request, dispatch to endpoint, send response."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "runtime",
          "title": "Runtime",
          "section": "API Server",
          "summary": "Backend-specific server runtime aliases and wrappers.",
          "overview": [
            "Keeps the HTTP/routes layer shared across Vulkan and Metal backends."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/",
          "source_path": "src/server/runtime.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L8",
          "counts": {
            "code_lines": 68,
            "exports": 20,
            "methods": 0,
            "symbols": 20
          },
          "symbols": [
            {
              "name": "is_metal",
              "qualified_name": "is_metal",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const is_metal = gpu.is_metal",
              "anchor": "is-metal",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#is-metal",
              "source_path": "src/server/runtime.zig",
              "source_line": 8,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L8",
              "doc": {
                "summary": "Whether the active GPU backend is Apple Metal.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether the active GPU backend is Apple Metal."
              },
              "members": []
            },
            {
              "name": "is_vulkan",
              "qualified_name": "is_vulkan",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const is_vulkan = gpu.is_vulkan",
              "anchor": "is-vulkan",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#is-vulkan",
              "source_path": "src/server/runtime.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L10",
              "doc": {
                "summary": "Whether the active GPU backend is Vulkan.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether the active GPU backend is Vulkan."
              },
              "members": []
            },
            {
              "name": "supports_model_management",
              "qualified_name": "supports_model_management",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const supports_model_management = gpu.is_vulkan or gpu.is_metal",
              "anchor": "supports-model-management",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#supports-model-management",
              "source_path": "src/server/runtime.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L12",
              "doc": {
                "summary": "Whether the backend supports loading/unloading models at runtime.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether the backend supports loading/unloading models at runtime."
              },
              "members": []
            },
            {
              "name": "supports_sampling_controls",
              "qualified_name": "supports_sampling_controls",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const supports_sampling_controls = gpu.is_vulkan or gpu.is_metal",
              "anchor": "supports-sampling-controls",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#supports-sampling-controls",
              "source_path": "src/server/runtime.zig",
              "source_line": 14,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L14",
              "doc": {
                "summary": "Whether the backend supports temperature, top-p, top-k, and repetition penalty.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether the backend supports temperature, top-p, top-k, and repetition penalty."
              },
              "members": []
            },
            {
              "name": "supports_runtime_profiling",
              "qualified_name": "supports_runtime_profiling",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const supports_runtime_profiling = gpu.is_vulkan or gpu.is_metal",
              "anchor": "supports-runtime-profiling",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#supports-runtime-profiling",
              "source_path": "src/server/runtime.zig",
              "source_line": 16,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L16",
              "doc": {
                "summary": "Whether the backend supports GPU kernel profiling during inference.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Whether the backend supports GPU kernel profiling during inference."
              },
              "members": []
            },
            {
              "name": "tokenizer_mod",
              "qualified_name": "tokenizer_mod",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const tokenizer_mod = @import(\"../model/tokenizer.zig\")",
              "anchor": "tokenizer-mod",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#tokenizer-mod",
              "source_path": "src/server/runtime.zig",
              "source_line": 19,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L19",
              "doc": {
                "summary": "Tokenizer module (shared across all backends).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Tokenizer module (shared across all backends)."
              },
              "members": []
            },
            {
              "name": "forward_mod",
              "qualified_name": "forward_mod",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const forward_mod = if (gpu.is_metal) @import(\"../compute/forward_metal.zig\") else @import(\"../compute/forward.zig\")",
              "anchor": "forward-mod",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#forward-mod",
              "source_path": "src/server/runtime.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L21",
              "doc": {
                "summary": "Forward-pass module, selected by the active backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Forward-pass module, selected by the active backend."
              },
              "members": []
            },
            {
              "name": "loader_mod",
              "qualified_name": "loader_mod",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const loader_mod = if (gpu.is_metal) @import(\"../model/loader_metal.zig\") else @import(\"../model/loader.zig\")",
              "anchor": "loader-mod",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#loader-mod",
              "source_path": "src/server/runtime.zig",
              "source_line": 23,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L23",
              "doc": {
                "summary": "Model-loading module, selected by the active backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Model-loading module, selected by the active backend."
              },
              "members": []
            },
            {
              "name": "model_manager_mod",
              "qualified_name": "model_manager_mod",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const model_manager_mod = if (gpu.is_metal) @import(\"model_manager_metal.zig\") else @import(\"model_manager.zig\")",
              "anchor": "model-manager-mod",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#model-manager-mod",
              "source_path": "src/server/runtime.zig",
              "source_line": 25,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L25",
              "doc": {
                "summary": "Model-manager module, selected by the active backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Model-manager module, selected by the active backend."
              },
              "members": []
            },
            {
              "name": "InferenceEngine",
              "qualified_name": "InferenceEngine",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const InferenceEngine = forward_mod.InferenceEngine",
              "anchor": "inference-engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#inference-engine",
              "source_path": "src/server/runtime.zig",
              "source_line": 28,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L28",
              "doc": {
                "summary": "Backend-specific inference engine that runs the forward pass.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Backend-specific inference engine that runs the forward pass."
              },
              "members": []
            },
            {
              "name": "DecodeState",
              "qualified_name": "DecodeState",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const DecodeState = forward_mod.DecodeState",
              "anchor": "decode-state",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#decode-state",
              "source_path": "src/server/runtime.zig",
              "source_line": 30,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L30",
              "doc": {
                "summary": "Per-sequence decode state (KV cache position, token history, etc.).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-sequence decode state (KV cache position, token history, etc.)."
              },
              "members": []
            },
            {
              "name": "Model",
              "qualified_name": "Model",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const Model = loader_mod.Model",
              "anchor": "model",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#model",
              "source_path": "src/server/runtime.zig",
              "source_line": 32,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L32",
              "doc": {
                "summary": "Loaded model handle (weights, hyperparams, GGUF metadata).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Loaded model handle (weights, hyperparams, GGUF metadata)."
              },
              "members": []
            },
            {
              "name": "ModelManager",
              "qualified_name": "ModelManager",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const ModelManager = model_manager_mod.ModelManager",
              "anchor": "model-manager",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#model-manager",
              "source_path": "src/server/runtime.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L34",
              "doc": {
                "summary": "Manages loading, unloading, and switching between models at runtime.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Manages loading, unloading, and switching between models at runtime."
              },
              "members": []
            },
            {
              "name": "SamplingParams",
              "qualified_name": "SamplingParams",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const SamplingParams = forward_mod.SamplingParams",
              "anchor": "sampling-params",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#sampling-params",
              "source_path": "src/server/runtime.zig",
              "source_line": 37,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L37",
              "doc": {
                "summary": "Token sampling parameters (shared across Vulkan and Metal backends).",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Token sampling parameters (shared across Vulkan and Metal backends)."
              },
              "members": []
            },
            {
              "name": "enableLogitsReadback",
              "qualified_name": "enableLogitsReadback",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn enableLogitsReadback(_engine: *InferenceEngine) void",
              "anchor": "enable-logits-readback",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#enable-logits-readback",
              "source_path": "src/server/runtime.zig",
              "source_line": 42,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L42",
              "doc": {
                "summary": "Enable logits readback from GPU so sampling can inspect raw logits.",
                "description": [
                  "On Metal (UMA) logits are always CPU-accessible, so this is a no-op."
                ],
                "params": [
                  {
                    "name": "_engine",
                    "description": "Inference engine whose readback mode is updated."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Enable logits readback from GPU so sampling can inspect raw logits.\nOn Metal (UMA) logits are always CPU-accessible, so this is a no-op."
              },
              "members": []
            },
            {
              "name": "logitsReadbackEnabled",
              "qualified_name": "logitsReadbackEnabled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn logitsReadbackEnabled(_engine: *const InferenceEngine) bool",
              "anchor": "logits-readback-enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#logits-readback-enabled",
              "source_path": "src/server/runtime.zig",
              "source_line": 54,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L54",
              "doc": {
                "summary": "Return whether logits readback is currently enabled on the engine.",
                "description": [
                  "Always returns `true` on Metal because UMA makes logits CPU-accessible without an explicit readback step."
                ],
                "params": [
                  {
                    "name": "_engine",
                    "description": "Inference engine to query."
                  }
                ],
                "returns": "`true` if the engine will expose logits after each decode step.",
                "notes": [],
                "raw": "Return whether logits readback is currently enabled on the engine.\nAlways returns `true` on Metal because UMA makes logits CPU-accessible without an explicit readback step."
              },
              "members": []
            },
            {
              "name": "setLogitsReadbackEnabled",
              "qualified_name": "setLogitsReadbackEnabled",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn setLogitsReadbackEnabled(_engine: *InferenceEngine, _enabled: bool) void",
              "anchor": "set-logits-readback-enabled",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#set-logits-readback-enabled",
              "source_path": "src/server/runtime.zig",
              "source_line": 64,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L64",
              "doc": {
                "summary": "Set the logits readback intent flag on backends that can elide full logit materialization.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Set the logits readback intent flag on backends that can elide full logit materialization."
              },
              "members": []
            },
            {
              "name": "enableProfiling",
              "qualified_name": "enableProfiling",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn enableProfiling(_engine: *InferenceEngine) !void",
              "anchor": "enable-profiling",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#enable-profiling",
              "source_path": "src/server/runtime.zig",
              "source_line": 76,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L76",
              "doc": {
                "summary": "Enable GPU kernel profiling on the inference engine.",
                "description": [
                  "Supported on both Vulkan and Metal backends; calls the backend's own `enableProfiling` method."
                ],
                "params": [
                  {
                    "name": "_engine",
                    "description": "Inference engine to configure for profiling."
                  }
                ],
                "returns": "An error if the backend's profiling setup fails (e.g. out of GPU resources).",
                "notes": [],
                "raw": "Enable GPU kernel profiling on the inference engine.\nSupported on both Vulkan and Metal backends; calls the backend's own `enableProfiling` method."
              },
              "members": []
            },
            {
              "name": "decodeStep",
              "qualified_name": "decodeStep",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn decodeStep( _engine: *InferenceEngine, _state: *DecodeState, _token_id: u32, _collect_output: bool, ) !void",
              "anchor": "decode-step",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#decode-step",
              "source_path": "src/server/runtime.zig",
              "source_line": 90,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L90",
              "doc": {
                "summary": "Run a single autoregressive decode step, advancing the KV cache by one token.",
                "description": [],
                "params": [
                  {
                    "name": "_engine",
                    "description": "Inference engine that owns the model weights and KV cache."
                  },
                  {
                    "name": "_state",
                    "description": "Per-sequence decode state tracking position and token history."
                  },
                  {
                    "name": "_token_id",
                    "description": "Input token to feed into the model for this step."
                  },
                  {
                    "name": "_collect_output",
                    "description": "When `true`, copy output logits to CPU (Vulkan only; ignored on Metal where logits are always accessible)."
                  }
                ],
                "returns": "An error if the GPU submission or synchronisation fails.",
                "notes": [],
                "raw": "Run a single autoregressive decode step, advancing the KV cache by one token."
              },
              "members": []
            },
            {
              "name": "sample",
              "qualified_name": "sample",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn sample( _engine: *const InferenceEngine, _state: *const DecodeState, _params: SamplingParams, _random: std.Random, ) u32",
              "anchor": "sample",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/runtime/#sample",
              "source_path": "src/server/runtime.zig",
              "source_line": 109,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/runtime.zig#L109",
              "doc": {
                "summary": "Sample the next token from the model's logit distribution.",
                "description": [],
                "params": [
                  {
                    "name": "_engine",
                    "description": "Inference engine holding the current logits."
                  },
                  {
                    "name": "_state",
                    "description": "Decode state used to retrieve generated-token history for repetition penalty."
                  },
                  {
                    "name": "_params",
                    "description": "Sampling configuration (temperature, top-p, top-k, repetition penalty, etc.)."
                  },
                  {
                    "name": "_random",
                    "description": "PRNG source for stochastic sampling."
                  }
                ],
                "returns": "The sampled token ID.",
                "notes": [],
                "raw": "Sample the next token from the model's logit distribution."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "tool-calling",
      "title": "Tool Calling",
      "description": "Tool-use protocol helpers: chat-template-aware tool definitions, argument parsing, and response formatting for function-calling-capable models.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#tool-calling",
      "module_count": 1,
      "symbol_count": 19,
      "modules": [
        {
          "slug": "tool-format",
          "title": "Tool Format",
          "section": "Tool Calling",
          "summary": "Pluggable tool-calling format dispatch for chat completions.",
          "overview": [
            "`chatmlToolFormat()` handles Qwen3-family models. `NoopToolFormat` is the silent fallback for any other template kind."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/",
          "source_path": "src/server/tool_format.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L26",
          "counts": {
            "code_lines": 622,
            "exports": 10,
            "methods": 9,
            "symbols": 19
          },
          "symbols": [
            {
              "name": "ToolDefinition",
              "qualified_name": "ToolDefinition",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ToolDefinition = struct",
              "anchor": "tool-definition",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-definition",
              "source_path": "src/server/tool_format.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L26",
              "doc": {
                "summary": "One tool definition extracted from the request's `tools` array.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One tool definition extracted from the request's `tools` array."
              },
              "members": []
            },
            {
              "name": "ToolCall",
              "qualified_name": "ToolCall",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ToolCall = struct",
              "anchor": "tool-call",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-call",
              "source_path": "src/server/tool_format.zig",
              "source_line": 34,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L34",
              "doc": {
                "summary": "One parsed tool call extracted from assistant output.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "One parsed tool call extracted from assistant output."
              },
              "members": []
            },
            {
              "name": "ParsedAssistantOutput",
              "qualified_name": "ParsedAssistantOutput",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ParsedAssistantOutput = struct",
              "anchor": "parsed-assistant-output",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#parsed-assistant-output",
              "source_path": "src/server/tool_format.zig",
              "source_line": 47,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L47",
              "doc": {
                "summary": "Result of parsing a non-streaming assistant message: the prose the user should see and any tool invocations the model emitted.",
                "description": [
                  "Returned by `ToolFormat.parseAssistantToolCalls` and consumed by the chat completions response builder when deciding between a `content` reply and a `tool_calls` reply."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Result of parsing a non-streaming assistant message: the prose the user\nshould see and any tool invocations the model emitted. Returned by\n`ToolFormat.parseAssistantToolCalls` and consumed by the chat completions\nresponse builder when deciding between a `content` reply and a `tool_calls`\nreply."
              },
              "members": []
            },
            {
              "name": "FeedResult",
              "qualified_name": "FeedResult",
              "declaration_kind": "const",
              "kind": "enum",
              "signature": "pub const FeedResult = enum",
              "anchor": "feed-result",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#feed-result",
              "source_path": "src/server/tool_format.zig",
              "source_line": 58,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L58",
              "doc": {
                "summary": "Disposition of a streaming chunk after the `StreamingDetector` has inspected it.",
                "description": [
                  "The chat completions streamer uses this to decide whether to forward bytes as a `content` delta, swallow them for further inspection, or flush a finished tool call."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Disposition of a streaming chunk after the `StreamingDetector` has inspected\nit. The chat completions streamer uses this to decide whether to forward\nbytes as a `content` delta, swallow them for further inspection, or flush\na finished tool call."
              },
              "members": []
            },
            {
              "name": "StreamingDetector",
              "qualified_name": "StreamingDetector",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const StreamingDetector = struct",
              "anchor": "streaming-detector",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector",
              "source_path": "src/server/tool_format.zig",
              "source_line": 71,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L71",
              "doc": {
                "summary": "Streaming-mode tool-call detector.",
                "description": [
                  "The chat completions handler feeds each decoded chunk through this state machine; the detector buffers bytes that might be the start of a `<tool_call>` tag and flushes them either as content deltas or as parsed tool calls. One detector per streaming request."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Streaming-mode tool-call detector. The chat completions handler feeds each\ndecoded chunk through this state machine; the detector buffers bytes that\nmight be the start of a `<tool_call>` tag and flushes them either as\ncontent deltas or as parsed tool calls. One detector per streaming request."
              },
              "members": [
                {
                  "name": "deinit",
                  "qualified_name": "StreamingDetector.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *StreamingDetector) void",
                  "anchor": "streaming-detector-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector-deinit",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 86,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L86",
                  "doc": {
                    "summary": "Free the internal buffers and any pending tool-call payloads.",
                    "description": [
                      "Safe to call once at end-of-stream regardless of how many `feed` calls happened."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Free the internal buffers and any pending tool-call payloads. Safe to\ncall once at end-of-stream regardless of how many `feed` calls happened."
                  }
                },
                {
                  "name": "feed",
                  "qualified_name": "StreamingDetector.feed",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn feed(self: *StreamingDetector, chunk: []const u8) !FeedResult",
                  "anchor": "streaming-detector-feed",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector-feed",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 104,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L104",
                  "doc": {
                    "summary": "Push the next decoded chunk into the detector and return how the caller should react.",
                    "description": [
                      "The detector retains ownership of `chunk`'s contribution to the internal buffer; callers should drain via `takeContentDelta` and `takePendingToolCall` between feeds. tool call is ready to consume, or the bytes are still being held."
                    ],
                    "params": [
                      {
                        "name": "chunk",
                        "description": "Newly decoded model bytes."
                      }
                    ],
                    "returns": "A `FeedResult` indicating whether content is ready to emit, a",
                    "notes": [],
                    "raw": "Push the next decoded chunk into the detector and return how the caller\nshould react. The detector retains ownership of `chunk`'s contribution\nto the internal buffer; callers should drain via `takeContentDelta` and\n`takePendingToolCall` between feeds.\ntool call is ready to consume, or the bytes are still being held."
                  }
                },
                {
                  "name": "takeContentDelta",
                  "qualified_name": "StreamingDetector.takeContentDelta",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn takeContentDelta(self: *StreamingDetector) []const u8",
                  "anchor": "streaming-detector-take-content-delta",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector-take-content-delta",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 220,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L220",
                  "doc": {
                    "summary": "Drain pending content bytes.",
                    "description": [
                      "The returned slice aliases the detector's internal buffer — consume it before the next feed call (subsequent feeds will overwrite the same allocation). The detector retains ownership and the buffer is freed by deinit."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Drain pending content bytes. The returned slice aliases the detector's\ninternal buffer — consume it before the next feed call (subsequent feeds\nwill overwrite the same allocation). The detector retains ownership and\nthe buffer is freed by deinit."
                  }
                },
                {
                  "name": "takePendingToolCall",
                  "qualified_name": "StreamingDetector.takePendingToolCall",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn takePendingToolCall(self: *StreamingDetector) ?ToolCall",
                  "anchor": "streaming-detector-take-pending-tool-call",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector-take-pending-tool-call",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 230,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L230",
                  "doc": {
                    "summary": "Drain one fully parsed tool call, FIFO order.",
                    "description": [
                      "Caller takes ownership of the returned `id`/`name`/`arguments_json` slices and must free them with the same allocator that initialized this detector. Returns null when the queue is empty."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Drain one fully parsed tool call, FIFO order. Caller takes ownership of\nthe returned `id`/`name`/`arguments_json` slices and must free them with\nthe same allocator that initialized this detector. Returns null when the\nqueue is empty."
                  }
                },
                {
                  "name": "finalize",
                  "qualified_name": "StreamingDetector.finalize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn finalize(self: *StreamingDetector) []const u8",
                  "anchor": "streaming-detector-finalize",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#streaming-detector-finalize",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 239,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L239",
                  "doc": {
                    "summary": "Flush all remaining buffered bytes as content at end of stream.",
                    "description": [
                      "Any bytes still held in the speculative-match buffer are appended to the pending content buffer, and the combined slice is returned. The returned slice aliases the internal buffer; consume before calling deinit."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Flush all remaining buffered bytes as content at end of stream. Any bytes\nstill held in the speculative-match buffer are appended to the pending\ncontent buffer, and the combined slice is returned. The returned slice\naliases the internal buffer; consume before calling deinit."
                  }
                }
              ]
            },
            {
              "name": "ToolFormat",
              "qualified_name": "ToolFormat",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ToolFormat = struct",
              "anchor": "tool-format",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-format",
              "source_path": "src/server/tool_format.zig",
              "source_line": 254,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L254",
              "doc": {
                "summary": "Vtable interface to a per-template tool-call format.",
                "description": [
                  "Lets the chat completions path render tool definitions, parse tool calls out of model output, and create matching streaming detectors without knowing whether the active template is ChatML, llama3, or anything else. Concrete implementations are minted via `forTemplate` or the per-format factories `chatmlToolFormat` / `noopToolFormat`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Vtable interface to a per-template tool-call format. Lets the chat\ncompletions path render tool definitions, parse tool calls out of model\noutput, and create matching streaming detectors without knowing whether\nthe active template is ChatML, llama3, or anything else. Concrete\nimplementations are minted via `forTemplate` or the per-format factories\n`chatmlToolFormat` / `noopToolFormat`."
              },
              "members": [
                {
                  "name": "renderToolDefinitions",
                  "qualified_name": "ToolFormat.renderToolDefinitions",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn renderToolDefinitions( self: ToolFormat, tools: []const ToolDefinition, buf: *std.ArrayList(u8), allocator: std.mem.Allocator, ) anyerror!void",
                  "anchor": "tool-format-render-tool-definitions",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-format-render-tool-definitions",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 290,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L290",
                  "doc": {
                    "summary": "Append the format-specific rendering of `tools` (e.g.",
                    "description": [
                      "Qwen's `# Tools\\n<tools>...</tools>` block) to `buf`, ready to be spliced into the system message. Noop formats append nothing."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Append the format-specific rendering of `tools` (e.g. Qwen's\n`# Tools\\n<tools>...</tools>` block) to `buf`, ready to be spliced into\nthe system message. Noop formats append nothing."
                  }
                },
                {
                  "name": "renderToolResultMessage",
                  "qualified_name": "ToolFormat.renderToolResultMessage",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn renderToolResultMessage( self: ToolFormat, tool_call_id: []const u8, content: []const u8, buf: *std.ArrayList(u8), allocator: std.mem.Allocator, ) anyerror!void",
                  "anchor": "tool-format-render-tool-result-message",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-format-render-tool-result-message",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 302,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L302",
                  "doc": {
                    "summary": "Append the format-specific tool-result message (e.g.",
                    "description": [
                      "ChatML's `<tool_response>...</tool_response>`) to `buf`. Used when replaying `role: \"tool\"` history entries into the prompt."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Append the format-specific tool-result message (e.g. ChatML's\n`<tool_response>...</tool_response>`) to `buf`. Used when replaying\n`role: \"tool\"` history entries into the prompt."
                  }
                },
                {
                  "name": "parseAssistantToolCalls",
                  "qualified_name": "ToolFormat.parseAssistantToolCalls",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn parseAssistantToolCalls( self: ToolFormat, model_output: []const u8, allocator: std.mem.Allocator, ) anyerror!ParsedAssistantOutput",
                  "anchor": "tool-format-parse-assistant-tool-calls",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-format-parse-assistant-tool-calls",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 315,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L315",
                  "doc": {
                    "summary": "Split a complete (non-streaming) assistant response into prose plus a list of structured tool calls.",
                    "description": [
                      "Allocates the returned slices with the caller's allocator; ownership transfers to the caller."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Split a complete (non-streaming) assistant response into prose plus a\nlist of structured tool calls. Allocates the returned slices with the\ncaller's allocator; ownership transfers to the caller."
                  }
                },
                {
                  "name": "newStreamingDetector",
                  "qualified_name": "ToolFormat.newStreamingDetector",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn newStreamingDetector( self: ToolFormat, allocator: std.mem.Allocator, ) anyerror!*StreamingDetector",
                  "anchor": "tool-format-new-streaming-detector",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#tool-format-new-streaming-detector",
                  "source_path": "src/server/tool_format.zig",
                  "source_line": 325,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L325",
                  "doc": {
                    "summary": "Create a fresh streaming-mode detector for one chat completion stream.",
                    "description": [
                      "Caller owns the returned pointer and must `deinit` + `destroy` it."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Create a fresh streaming-mode detector for one chat completion stream.\nCaller owns the returned pointer and must `deinit` + `destroy` it."
                  }
                }
              ]
            },
            {
              "name": "NoopToolFormat",
              "qualified_name": "NoopToolFormat",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const NoopToolFormat = struct",
              "anchor": "noop-tool-format",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#noop-tool-format",
              "source_path": "src/server/tool_format.zig",
              "source_line": 341,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L341",
              "doc": {
                "summary": "Silent fallback `ToolFormat` for templates that don't have a tool-call dialect wired in (everything except ChatML today).",
                "description": [
                  "Definition rendering is a no-op, parsing returns the model output verbatim with no tool calls, and the streaming detector treats everything as content."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Silent fallback `ToolFormat` for templates that don't have a tool-call\ndialect wired in (everything except ChatML today). Definition rendering is\na no-op, parsing returns the model output verbatim with no tool calls, and\nthe streaming detector treats everything as content."
              },
              "members": []
            },
            {
              "name": "noopToolFormat",
              "qualified_name": "noopToolFormat",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn noopToolFormat() ToolFormat",
              "anchor": "noop-tool-format",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#noop-tool-format",
              "source_path": "src/server/tool_format.zig",
              "source_line": 371,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L371",
              "doc": {
                "summary": "Build a `ToolFormat` backed by `NoopToolFormat`.",
                "description": [
                  "Returned value is cheap to pass around and shares a single static instance."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Build a `ToolFormat` backed by `NoopToolFormat`. Returned value is cheap to\npass around and shares a single static instance."
              },
              "members": []
            },
            {
              "name": "forTemplate",
              "qualified_name": "forTemplate",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn forTemplate(template_kind: TemplateKind) ToolFormat",
              "anchor": "for-template",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#for-template",
              "source_path": "src/server/tool_format.zig",
              "source_line": 385,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L385",
              "doc": {
                "summary": "Pick the right `ToolFormat` for a chat template family.",
                "description": [
                  "ChatML maps to the Qwen3-style `<tool_call>` dialect; everything else falls through to the no-op format (tools field accepted but silently ignored downstream)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Pick the right `ToolFormat` for a chat template family. ChatML maps to the\nQwen3-style `<tool_call>` dialect; everything else falls through to the\nno-op format (tools field accepted but silently ignored downstream)."
              },
              "members": []
            },
            {
              "name": "chatmlToolFormat",
              "qualified_name": "chatmlToolFormat",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn chatmlToolFormat() ToolFormat",
              "anchor": "chatml-tool-format",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/tool-format/#chatml-tool-format",
              "source_path": "src/server/tool_format.zig",
              "source_line": 595,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/tool_format.zig#L595",
              "doc": {
                "summary": "Build a `ToolFormat` that emits the Qwen3-family `<tool_call>...` dialect.",
                "description": [
                  "Used for any template detected as ChatML. Returned value is cheap to pass around and shares a single static instance."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Build a `ToolFormat` that emits the Qwen3-family `<tool_call>...` dialect.\nUsed for any template detected as ChatML. Returned value is cheap to pass\naround and shares a single static instance."
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "cuda-runtime",
      "title": "CUDA Runtime",
      "description": "CUDA device discovery, context management, device buffers, NVRTC-compiled pipelines, and stream-based command submission for the NVIDIA backend.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#cuda-runtime",
      "module_count": 9,
      "symbol_count": 44,
      "modules": [
        {
          "slug": "buffer",
          "title": "Buffer",
          "section": "CUDA Runtime",
          "summary": "CUDA buffer wrapper — device-local allocations with optional pinned staging.",
          "overview": [
            "Unlike Metal (Apple unified memory), CUDA device memory is NOT CPU-visible; host<->device transfers are explicit (`upload`/`download`), staged through pinned host memory. Mirrors src/metal/buffer.zig."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/",
          "source_path": "src/cuda/buffer.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L11",
          "counts": {
            "code_lines": 62,
            "exports": 12,
            "methods": 2,
            "symbols": 14
          },
          "symbols": [
            {
              "name": "CudaBuffer",
              "qualified_name": "CudaBuffer",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CudaBuffer = struct",
              "anchor": "cuda-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#cuda-buffer",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 11,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L11",
              "doc": {
                "summary": "CUDA device buffer handle plus optional pinned-host staging mirror.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "CUDA device buffer handle plus optional pinned-host staging mirror."
              },
              "members": [
                {
                  "name": "devicePtr",
                  "qualified_name": "CudaBuffer.devicePtr",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn devicePtr(self: *const CudaBuffer) u64",
                  "anchor": "cuda-buffer-device-ptr",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#cuda-buffer-device-ptr",
                  "source_path": "src/cuda/buffer.zig",
                  "source_line": 20,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L20",
                  "doc": {
                    "summary": "Raw device pointer (CUdeviceptr as u64) for kernel arg packing / aliasing.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Raw device pointer (CUdeviceptr as u64) for kernel arg packing / aliasing."
                  }
                },
                {
                  "name": "contents",
                  "qualified_name": "CudaBuffer.contents",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn contents(self: *const CudaBuffer) ?[*]u8",
                  "anchor": "cuda-buffer-contents",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#cuda-buffer-contents",
                  "source_path": "src/cuda/buffer.zig",
                  "source_line": 26,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L26",
                  "doc": {
                    "summary": "Pinned host staging pointer, if this buffer was created staged.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Pinned host staging pointer, if this buffer was created staged."
                  }
                }
              ]
            },
            {
              "name": "createBuffer",
              "qualified_name": "createBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createBuffer(ctx: ?*shim.CudaCtx, size: usize) !CudaBuffer",
              "anchor": "create-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#create-buffer",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 36,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L36",
              "doc": {
                "summary": "Allocate a device-local buffer (the common case for weights/activations/state).",
                "description": [],
                "params": [
                  {
                    "name": "ctx",
                    "description": "CUDA context that owns the allocation."
                  },
                  {
                    "name": "size",
                    "description": "Number of bytes to allocate on the device."
                  }
                ],
                "returns": "A `CudaBuffer` with no host staging pointer; use `createBufferStaged` when CPU access is needed.",
                "notes": [
                  "Returns `error.CudaBufferAllocFailed` if the shim returns a null handle."
                ],
                "raw": "Allocate a device-local buffer (the common case for weights/activations/state)."
              },
              "members": []
            },
            {
              "name": "createBufferStaged",
              "qualified_name": "createBufferStaged",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createBufferStaged(ctx: ?*shim.CudaCtx, size: usize) !CudaBuffer",
              "anchor": "create-buffer-staged",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#create-buffer-staged",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 48,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L48",
              "doc": {
                "summary": "Allocate a device buffer paired with a pinned-host staging mirror for fast `upload`/`download`.",
                "description": [
                  "The host pointer is exposed via `contents()`."
                ],
                "params": [
                  {
                    "name": "ctx",
                    "description": "CUDA context that owns the allocation."
                  },
                  {
                    "name": "size",
                    "description": "Number of bytes to allocate on both the device and in pinned host memory."
                  }
                ],
                "returns": "A `CudaBuffer` whose `host_ptr` field is non-null; `contents()` returns the pinned staging address.",
                "notes": [
                  "Returns `error.CudaBufferAllocFailed` if the shim returns a null handle."
                ],
                "raw": "Allocate a device buffer paired with a pinned-host staging mirror for fast\n`upload`/`download`. The host pointer is exposed via `contents()`."
              },
              "members": []
            },
            {
              "name": "uploadMmap",
              "qualified_name": "uploadMmap",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn uploadMmap(ctx: ?*shim.CudaCtx, host_ptr: *const anyopaque, size: usize) !CudaBuffer",
              "anchor": "upload-mmap",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#upload-mmap",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 62,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L62",
              "doc": {
                "summary": "Copy an existing host mapping (e.g.",
                "description": [
                  "mmap'd weights) to a new device-local buffer. Unlike Metal's zero-copy wrapMmap, this performs a full host-to-device copy."
                ],
                "params": [
                  {
                    "name": "ctx",
                    "description": "CUDA context that will own the resulting device allocation."
                  },
                  {
                    "name": "host_ptr",
                    "description": "Pointer to the host memory region to copy from (typically an mmap'd file mapping)."
                  },
                  {
                    "name": "size",
                    "description": "Number of bytes to transfer."
                  }
                ],
                "returns": "A device-local `CudaBuffer`; `host_ptr` is null (data lives only on device after this call).",
                "notes": [
                  "Returns `error.CudaMmapUploadFailed` if the shim returns a null handle."
                ],
                "raw": "Copy an existing host mapping (e.g. mmap'd weights) to a new device-local buffer.\nUnlike Metal's zero-copy wrapMmap, this performs a full host-to-device copy."
              },
              "members": []
            },
            {
              "name": "aliasBuffer",
              "qualified_name": "aliasBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn aliasBuffer(base: *const CudaBuffer, offset: usize, size: usize) !CudaBuffer",
              "anchor": "alias-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#alias-buffer",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 74,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L74",
              "doc": {
                "summary": "Create a lightweight view into an existing buffer's device allocation.",
                "description": [],
                "params": [
                  {
                    "name": "base",
                    "description": "Parent buffer whose device memory is aliased."
                  },
                  {
                    "name": "offset",
                    "description": "Byte offset from the start of `base`'s device allocation."
                  },
                  {
                    "name": "size",
                    "description": "Number of bytes the alias covers."
                  }
                ],
                "returns": "A `CudaBuffer` with `owns_handle = false`; calling `freeBuffer` on it releases only the wrapper, not the parent's device memory.",
                "notes": [
                  "Returns `error.CudaBufferAllocFailed` if the shim returns a null handle."
                ],
                "raw": "Create a lightweight view into an existing buffer's device allocation."
              },
              "members": []
            },
            {
              "name": "freeBuffer",
              "qualified_name": "freeBuffer",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freeBuffer(buf: *CudaBuffer) void",
              "anchor": "free-buffer",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#free-buffer",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 82,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L82",
              "doc": {
                "summary": "Free a buffer handle (the shim only releases device memory if this buffer owns it — aliases just free the wrapper).",
                "description": [
                  "Safe with a null handle."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Free a buffer handle (the shim only releases device memory if this buffer\nowns it — aliases just free the wrapper). Safe with a null handle."
              },
              "members": []
            },
            {
              "name": "upload",
              "qualified_name": "upload",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn upload(ctx: ?*shim.CudaCtx, buf: *const CudaBuffer, data: []const u8) void",
              "anchor": "upload",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#upload",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 93,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L93",
              "doc": {
                "summary": "Copy bytes from host to device (synchronous on the context stream).",
                "description": [],
                "params": [
                  {
                    "name": "ctx",
                    "description": "CUDA context whose stream is used for the transfer."
                  },
                  {
                    "name": "buf",
                    "description": "Destination device buffer; must be at least `data.len` bytes."
                  },
                  {
                    "name": "data",
                    "description": "Source slice on the host."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Copy bytes from host to device (synchronous on the context stream)."
              },
              "members": []
            },
            {
              "name": "download",
              "qualified_name": "download",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn download(ctx: ?*shim.CudaCtx, buf: *const CudaBuffer, dst: []u8) void",
              "anchor": "download",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#download",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 101,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L101",
              "doc": {
                "summary": "Copy bytes from device to host (synchronous on the context stream).",
                "description": [],
                "params": [
                  {
                    "name": "ctx",
                    "description": "CUDA context whose stream is used for the transfer."
                  },
                  {
                    "name": "buf",
                    "description": "Source device buffer; must be at least `dst.len` bytes."
                  },
                  {
                    "name": "dst",
                    "description": "Destination slice on the host."
                  }
                ],
                "returns": null,
                "notes": [],
                "raw": "Copy bytes from device to host (synchronous on the context stream)."
              },
              "members": []
            },
            {
              "name": "uploadAsync",
              "qualified_name": "uploadAsync",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn uploadAsync(ctx: ?*shim.CudaCtx, buf: *const CudaBuffer, data: []const u8) void",
              "anchor": "upload-async",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#upload-async",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 107,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L107",
              "doc": {
                "summary": "Async host→device copy (no stream sync).",
                "description": [
                  "Capturable into a CUDA graph; the host side must be pinned (see `allocHost`). @see download(Async) for D2H."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Async host→device copy (no stream sync). Capturable into a CUDA graph; the\nhost side must be pinned (see `allocHost`). @see download(Async) for D2H."
              },
              "members": []
            },
            {
              "name": "downloadAsync",
              "qualified_name": "downloadAsync",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn downloadAsync(ctx: ?*shim.CudaCtx, buf: *const CudaBuffer, dst: []u8) void",
              "anchor": "download-async",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#download-async",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 113,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L113",
              "doc": {
                "summary": "Async device→host copy (no stream sync).",
                "description": [
                  "Capturable into a CUDA graph; the destination must be pinned host memory (see `allocHost`)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Async device→host copy (no stream sync). Capturable into a CUDA graph; the\ndestination must be pinned host memory (see `allocHost`)."
              },
              "members": []
            },
            {
              "name": "allocHost",
              "qualified_name": "allocHost",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn allocHost(comptime T: type, n: usize) ![]T",
              "anchor": "alloc-host",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#alloc-host",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 119,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L119",
              "doc": {
                "summary": "Pinned (page-locked) host allocation of `n` `T` values, required as the host endpoint of an async graph-captured copy.",
                "description": [
                  "Free with `freeHost`."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Pinned (page-locked) host allocation of `n` `T` values, required as the host\nendpoint of an async graph-captured copy. Free with `freeHost`."
              },
              "members": []
            },
            {
              "name": "freeHost",
              "qualified_name": "freeHost",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freeHost(slice: anytype) void",
              "anchor": "free-host",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/buffer/#free-host",
              "source_path": "src/cuda/buffer.zig",
              "source_line": 126,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/buffer.zig#L126",
              "doc": {
                "summary": "Free a pinned host allocation from `allocHost`.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Free a pinned host allocation from `allocHost`."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "c",
          "title": "C",
          "section": "CUDA Runtime",
          "summary": "Shared C import for the CUDA shim — all CUDA backend modules import from here to ensure type identity across compilation units (mirrors src/metal/c.zig).",
          "overview": [
            "Keeping the `@cImport` in one place avoids duplicate opaque C types across Zig compilation units, which is critical for safely passing shim handles between the CUDA device, buffer, pipeline, and command helpers."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/c/",
          "source_path": "src/cuda/c.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/c.zig#L9",
          "counts": {
            "code_lines": 1,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "shim",
              "qualified_name": "shim",
              "declaration_kind": "const",
              "kind": "constant",
              "signature": "pub const shim = @cImport(@cInclude(\"cuda_shim.h\"))",
              "anchor": "shim",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/c/#shim",
              "source_path": "src/cuda/c.zig",
              "source_line": 9,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/c.zig#L9",
              "doc": {
                "summary": "Raw CUDA shim C bindings (Driver API + NVRTC) imported from cuda_shim.h.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Raw CUDA shim C bindings (Driver API + NVRTC) imported from cuda_shim.h."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "command",
          "title": "Command",
          "section": "CUDA Runtime",
          "summary": "CUDA command wrapper — kernel dispatch and stream/event synchronization (mirrors src/metal/command.zig).",
          "overview": [
            "A CudaCommand wraps the context's CUstream plus a per-command CUevent; `commitAsync`/`wait`/`releaseCompleted` give the same overlap the Metal backend gets, backed by CUDA streams + events."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/",
          "source_path": "src/cuda/command.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L12",
          "counts": {
            "code_lines": 68,
            "exports": 2,
            "methods": 6,
            "symbols": 8
          },
          "symbols": [
            {
              "name": "CudaCommand",
              "qualified_name": "CudaCommand",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CudaCommand = struct",
              "anchor": "cuda-command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command",
              "source_path": "src/cuda/command.zig",
              "source_line": 12,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L12",
              "doc": {
                "summary": "A recorded stream batch that launches compute kernels on the GPU.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A recorded stream batch that launches compute kernels on the GPU."
              },
              "members": [
                {
                  "name": "dispatch",
                  "qualified_name": "CudaCommand.dispatch",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn dispatch( self: *CudaCommand, pipe: *const CudaPipeline, grid: [3]u32, block: [3]u32, bufs: []const *const CudaBuffer, push_data: ?*const anyopaque, push_size: usize, shared_bytes: u32, ) void",
                  "anchor": "cuda-command-dispatch",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-dispatch",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 27,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L27",
                  "doc": {
                    "summary": "Launch a kernel on this command's stream.",
                    "description": [
                      "Bound `bufs` become the leading device-pointer args (capped at 32); `push_data` (push_size bytes) is the trailing by-value push-constant arg."
                    ],
                    "params": [
                      {
                        "name": "pipe",
                        "description": "Compiled CUDA pipeline (kernel + argument layout) to execute."
                      },
                      {
                        "name": "grid",
                        "description": "3-D grid dimensions in thread-blocks (x, y, z)."
                      },
                      {
                        "name": "block",
                        "description": "3-D thread-block dimensions (x, y, z)."
                      },
                      {
                        "name": "bufs",
                        "description": "Device buffers passed as pointer args before the push constant."
                      },
                      {
                        "name": "push_data",
                        "description": "Pointer to the push-constant struct, or null if unused."
                      },
                      {
                        "name": "push_size",
                        "description": "Byte size of the push-constant struct."
                      },
                      {
                        "name": "shared_bytes",
                        "description": "Dynamic shared memory in bytes to allocate per block."
                      }
                    ],
                    "returns": null,
                    "notes": [],
                    "raw": "Launch a kernel on this command's stream.\nBound `bufs` become the leading device-pointer args (capped at 32);\n`push_data` (push_size bytes) is the trailing by-value push-constant arg."
                  }
                },
                {
                  "name": "barrier",
                  "qualified_name": "CudaCommand.barrier",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn barrier(self: *CudaCommand) void",
                  "anchor": "cuda-command-barrier",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-barrier",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 60,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L60",
                  "doc": {
                    "summary": "Same-stream launches are implicitly ordered; no-op for a single stream.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Same-stream launches are implicitly ordered; no-op for a single stream."
                  }
                },
                {
                  "name": "commitAndWait",
                  "qualified_name": "CudaCommand.commitAndWait",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn commitAndWait(self: *CudaCommand) void",
                  "anchor": "cuda-command-commit-and-wait",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-commit-and-wait",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 65,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L65",
                  "doc": {
                    "summary": "Record completion and block until the stream drains.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record completion and block until the stream drains."
                  }
                },
                {
                  "name": "commitAsync",
                  "qualified_name": "CudaCommand.commitAsync",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn commitAsync(self: *CudaCommand) void",
                  "anchor": "cuda-command-commit-async",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-commit-async",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 73,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L73",
                  "doc": {
                    "summary": "Record completion and return immediately; call `wait` later to sync.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Record completion and return immediately; call `wait` later to sync."
                  }
                },
                {
                  "name": "wait",
                  "qualified_name": "CudaCommand.wait",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn wait(self: *CudaCommand) void",
                  "anchor": "cuda-command-wait",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-wait",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 81,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L81",
                  "doc": {
                    "summary": "Block on a previously async-committed command's completion event.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Block on a previously async-committed command's completion event."
                  }
                },
                {
                  "name": "releaseCompleted",
                  "qualified_name": "CudaCommand.releaseCompleted",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn releaseCompleted(self: *CudaCommand) void",
                  "anchor": "cuda-command-release-completed",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#cuda-command-release-completed",
                  "source_path": "src/cuda/command.zig",
                  "source_line": 91,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L91",
                  "doc": {
                    "summary": "Release a command whose completion is guaranteed by a later queue-ordered synchronization (e.g.",
                    "description": [
                      "the caller waited on a subsequent command in the same stream). Frees the shim handle without issuing another wait."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Release a command whose completion is guaranteed by a later queue-ordered\nsynchronization (e.g. the caller waited on a subsequent command in the\nsame stream).  Frees the shim handle without issuing another wait."
                  }
                }
              ]
            },
            {
              "name": "beginCommand",
              "qualified_name": "beginCommand",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn beginCommand(ctx: ?*shim.CudaCtx) !CudaCommand",
              "anchor": "begin-command",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/command/#begin-command",
              "source_path": "src/cuda/command.zig",
              "source_line": 104,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/command.zig#L104",
              "doc": {
                "summary": "Begin a new command (stream batch + completion event) on the given context.",
                "description": [
                  "the underlying stream/event resources."
                ],
                "params": [
                  {
                    "name": "ctx",
                    "description": "Active CUDA context that owns the stream; must not be null."
                  }
                ],
                "returns": "A fresh `CudaCommand` ready for kernel dispatches.",
                "notes": [
                  "Returns `error.CudaCommandFailed` if the shim cannot allocate"
                ],
                "raw": "Begin a new command (stream batch + completion event) on the given context.\nthe underlying stream/event resources."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "device",
          "title": "Device",
          "section": "CUDA Runtime",
          "summary": "CUDA device wrapper — NVIDIA GPU backend (mirrors src/metal/device.zig).",
          "overview": [
            "Owns CUDA context init and capability queries used by the loader, diagnostics, and CUDA inference runtime."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/",
          "source_path": "src/cuda/device.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L10",
          "counts": {
            "code_lines": 91,
            "exports": 2,
            "methods": 10,
            "symbols": 12
          },
          "symbols": [
            {
              "name": "CudaCapabilities",
              "qualified_name": "CudaCapabilities",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CudaCapabilities = struct",
              "anchor": "cuda-capabilities",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-capabilities",
              "source_path": "src/cuda/device.zig",
              "source_line": 10,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L10",
              "doc": {
                "summary": "Capability snapshot queried once from the active CUDA device.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Capability snapshot queried once from the active CUDA device."
              },
              "members": []
            },
            {
              "name": "CudaDevice",
              "qualified_name": "CudaDevice",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CudaDevice = struct",
              "anchor": "cuda-device",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device",
              "source_path": "src/cuda/device.zig",
              "source_line": 21,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L21",
              "doc": {
                "summary": "Active CUDA device wrapper plus capability metadata used by the backend.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Active CUDA device wrapper plus capability metadata used by the backend."
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "CudaDevice.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init(allocator: std.mem.Allocator, device_index: u32) !CudaDevice",
                  "anchor": "cuda-device-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-init",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 31,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L31",
                  "doc": {
                    "summary": "Initialize a specific CUDA device by index and query its capabilities.",
                    "description": [],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Allocator stored for future use by the backend."
                      },
                      {
                        "name": "device_index",
                        "description": "Zero-based CUDA device ordinal."
                      }
                    ],
                    "returns": "Initialised `CudaDevice` with a live context, or `error.CudaInitFailed` if the shim rejects the index.",
                    "notes": [],
                    "raw": "Initialize a specific CUDA device by index and query its capabilities."
                  }
                },
                {
                  "name": "initBest",
                  "qualified_name": "CudaDevice.initBest",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn initBest(allocator: std.mem.Allocator) !CudaDevice",
                  "anchor": "cuda-device-init-best",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-init-best",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 47,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L47",
                  "doc": {
                    "summary": "Initialize the highest-compute-capability device (prefer 5090 over 4090).",
                    "description": [
                      "Probes up to 16 device indices, selects the one with the largest compute capability value, then opens a final context on that device via `init`."
                    ],
                    "params": [
                      {
                        "name": "allocator",
                        "description": "Forwarded to `init` for the selected device."
                      }
                    ],
                    "returns": "Initialised `CudaDevice` for the best device, or `error.CudaNoDevice` if no device is found.",
                    "notes": [],
                    "raw": "Initialize the highest-compute-capability device (prefer 5090 over 4090).\nProbes up to 16 device indices, selects the one with the largest compute capability\nvalue, then opens a final context on that device via `init`."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "CudaDevice.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *CudaDevice) void",
                  "anchor": "cuda-device-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-deinit",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 83,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L83",
                  "doc": {
                    "summary": "Destroy the active CUDA context.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Destroy the active CUDA context."
                  }
                },
                {
                  "name": "totalMemory",
                  "qualified_name": "CudaDevice.totalMemory",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn totalMemory(self: *const CudaDevice) u64",
                  "anchor": "cuda-device-total-memory",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-total-memory",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 91,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L91",
                  "doc": {
                    "summary": "Total device memory (VRAM capacity) in bytes.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Total device memory (VRAM capacity) in bytes."
                  }
                },
                {
                  "name": "freeMemory",
                  "qualified_name": "CudaDevice.freeMemory",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn freeMemory(self: *const CudaDevice) u64",
                  "anchor": "cuda-device-free-memory",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-free-memory",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 96,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L96",
                  "doc": {
                    "summary": "Currently free device memory in bytes; 0 if the context has been destroyed.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Currently free device memory in bytes; 0 if the context has been destroyed."
                  }
                },
                {
                  "name": "computeCapability",
                  "qualified_name": "CudaDevice.computeCapability",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn computeCapability(self: *const CudaDevice) u32",
                  "anchor": "cuda-device-compute-capability",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-compute-capability",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 102,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L102",
                  "doc": {
                    "summary": "Compute capability encoded as `major*10 + minor` (e.g.",
                    "description": [
                      "120 = sm_120)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Compute capability encoded as `major*10 + minor` (e.g. 120 = sm_120)."
                  }
                },
                {
                  "name": "smCount",
                  "qualified_name": "CudaDevice.smCount",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn smCount(self: *const CudaDevice) u32",
                  "anchor": "cuda-device-sm-count",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-sm-count",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 107,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L107",
                  "doc": {
                    "summary": "Number of streaming multiprocessors (SMs) on the device.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Number of streaming multiprocessors (SMs) on the device."
                  }
                },
                {
                  "name": "warpSize",
                  "qualified_name": "CudaDevice.warpSize",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn warpSize(self: *const CudaDevice) u32",
                  "anchor": "cuda-device-warp-size",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-warp-size",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 112,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L112",
                  "doc": {
                    "summary": "Threads per warp (32 on all current NVIDIA hardware).",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Threads per warp (32 on all current NVIDIA hardware)."
                  }
                },
                {
                  "name": "maxSharedMemPerBlock",
                  "qualified_name": "CudaDevice.maxSharedMemPerBlock",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn maxSharedMemPerBlock(self: *const CudaDevice) u64",
                  "anchor": "cuda-device-max-shared-mem-per-block",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-max-shared-mem-per-block",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 117,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L117",
                  "doc": {
                    "summary": "Maximum shared memory per block available with opt-in dynamic allocation, in bytes.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Maximum shared memory per block available with opt-in dynamic allocation, in bytes."
                  }
                },
                {
                  "name": "name",
                  "qualified_name": "CudaDevice.name",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn name(self: *const CudaDevice, buf: []u8) []const u8",
                  "anchor": "cuda-device-name",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/device/#cuda-device-name",
                  "source_path": "src/cuda/device.zig",
                  "source_line": 124,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/device.zig#L124",
                  "doc": {
                    "summary": "Copy the device name into `buf` and return the NUL-trimmed slice.",
                    "description": [],
                    "params": [
                      {
                        "name": "buf",
                        "description": "Caller-supplied scratch buffer; 64–256 bytes is typically sufficient."
                      }
                    ],
                    "returns": "Slice into `buf` containing the device name without a trailing NUL, or an empty slice if the context has been destroyed.",
                    "notes": [],
                    "raw": "Copy the device name into `buf` and return the NUL-trimmed slice."
                  }
                }
              ]
            }
          ]
        },
        {
          "slug": "pipeline",
          "title": "Pipeline",
          "section": "CUDA Runtime",
          "summary": "CUDA compute pipeline wrapper — NVRTC-compiled CUfunction (mirrors src/metal/pipeline.zig).",
          "overview": [
            "Compiles a `.cu` source string for the running device's arch (sm_XY) or loads a precompiled cubin/PTX image. Each pipeline holds a `CUmodule` + `CUfunction` pair obtained from the C shim. Use `createPipeline` for JIT compilation via NVRTC or `createPipelineFromImage` when an offline-compiled cubin/PTX blob is available. Free with `freePipeline` when done."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/",
          "source_path": "src/cuda/pipeline.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L13",
          "counts": {
            "code_lines": 35,
            "exports": 5,
            "methods": 0,
            "symbols": 5
          },
          "symbols": [
            {
              "name": "CudaPipeline",
              "qualified_name": "CudaPipeline",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const CudaPipeline = struct",
              "anchor": "cuda-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#cuda-pipeline",
              "source_path": "src/cuda/pipeline.zig",
              "source_line": 13,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L13",
              "doc": {
                "summary": "A compiled CUDA kernel ready for dispatch.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "A compiled CUDA kernel ready for dispatch."
              },
              "members": []
            },
            {
              "name": "createPipeline",
              "qualified_name": "createPipeline",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createPipeline(ctx: ?*shim.CudaCtx, cu_source: [*:0]const u8, fn_name: [*:0]const u8) !CudaPipeline",
              "anchor": "create-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-pipeline",
              "source_path": "src/cuda/pipeline.zig",
              "source_line": 29,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L29",
              "doc": {
                "summary": "NVRTC-compile `cu_source` and resolve `fn_name` for dispatch.",
                "description": [],
                "params": [
                  {
                    "name": "ctx",
                    "description": "Active CUDA context; must not be null."
                  },
                  {
                    "name": "cu_source",
                    "description": "Null-terminated CUDA C source string passed directly to NVRTC."
                  },
                  {
                    "name": "fn_name",
                    "description": "Null-terminated name of the kernel function to extract from the compiled module."
                  }
                ],
                "returns": "A `CudaPipeline` with populated `max_threads` and `shared_mem` fields, or `error.CudaPipelineCreateFailed`.",
                "notes": [],
                "raw": "NVRTC-compile `cu_source` and resolve `fn_name` for dispatch."
              },
              "members": []
            },
            {
              "name": "createPipelineFromImage",
              "qualified_name": "createPipelineFromImage",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn createPipelineFromImage(ctx: ?*shim.CudaCtx, image: [*]const u8, image_size: usize, fn_name: [*:0]const u8) !CudaPipeline",
              "anchor": "create-pipeline-from-image",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#create-pipeline-from-image",
              "source_path": "src/cuda/pipeline.zig",
              "source_line": 45,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L45",
              "doc": {
                "summary": "Load a kernel from a precompiled cubin/PTX image (offline nvcc path).",
                "description": [],
                "params": [
                  {
                    "name": "ctx",
                    "description": "Active CUDA context; must not be null."
                  },
                  {
                    "name": "image",
                    "description": "Pointer to the raw cubin or PTX image bytes."
                  },
                  {
                    "name": "image_size",
                    "description": "Byte length of `image`."
                  },
                  {
                    "name": "fn_name",
                    "description": "Null-terminated name of the kernel function to locate in the loaded module."
                  }
                ],
                "returns": "A `CudaPipeline` with populated `max_threads` and `shared_mem` fields, or `error.CudaPipelineCreateFailed`.",
                "notes": [],
                "raw": "Load a kernel from a precompiled cubin/PTX image (offline nvcc path)."
              },
              "members": []
            },
            {
              "name": "setMaxDynamicShared",
              "qualified_name": "setMaxDynamicShared",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn setMaxDynamicShared(pipe: *CudaPipeline, bytes: u32) void",
              "anchor": "set-max-dynamic-shared",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#set-max-dynamic-shared",
              "source_path": "src/cuda/pipeline.zig",
              "source_line": 60,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L60",
              "doc": {
                "summary": "Opt this kernel into a larger dynamic shared-memory cap (Ada/Blackwell).",
                "description": [
                  "default 48 KB barrier by calling `cuFuncSetAttribute` on the shim side."
                ],
                "params": [
                  {
                    "name": "pipe",
                    "description": "Pipeline whose dynamic shared-memory limit to raise."
                  },
                  {
                    "name": "bytes",
                    "description": "New maximum dynamic shared memory per block in bytes."
                  }
                ],
                "returns": null,
                "notes": [
                  "No-op when `pipe.handle` is null. On Ada/Blackwell this lifts the"
                ],
                "raw": "Opt this kernel into a larger dynamic shared-memory cap (Ada/Blackwell).\ndefault 48 KB barrier by calling `cuFuncSetAttribute` on the shim side."
              },
              "members": []
            },
            {
              "name": "freePipeline",
              "qualified_name": "freePipeline",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn freePipeline(pipe: *CudaPipeline) void",
              "anchor": "free-pipeline",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/pipeline/#free-pipeline",
              "source_path": "src/cuda/pipeline.zig",
              "source_line": 65,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/pipeline.zig#L65",
              "doc": {
                "summary": "Release the pipeline handle.",
                "description": [
                  "Safe to call with a null handle."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Release the pipeline handle. Safe to call with a null handle."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "smoke",
          "title": "Smoke",
          "section": "CUDA Runtime",
          "summary": "Standalone smoke test for the ZINC CUDA backend Zig wrapper layer. Drives the GPU entirely through device.zig / buffer.zig / pipeline.zig / command.zig (which wrap cuda_shim.c) — proving the Zig<->CUDA seam: device select, staged buffers + H2D/D2H, NVRTC runtime compile, the buffers+push dispatch ABI, and both sync and async commit paths.",
          "overview": [
            "Build (on the box): ~/zig-0.15.2/zig build-exe smoke.zig cuda_shim.c \\ -I. -I/usr/local/cuda/include -lc \\ -L/usr/local/cuda/lib64 -L/usr/lib/wsl/lib -lcuda -lnvrtc \\ -rpath /usr/local/cuda/lib64 -femit-bin=smoke_zig"
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/smoke/",
          "source_path": "src/cuda/smoke.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/smoke.zig#L37",
          "counts": {
            "code_lines": 77,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/smoke/#main",
              "source_path": "src/cuda/smoke.zig",
              "source_line": 37,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/cuda/smoke.zig#L37",
              "doc": {
                "summary": "Run the CUDA Zig<->shim smoke test end to end and report PASS/FAIL.",
                "description": [
                  "Selects the best device, then exercises the full seam: a `vadd` kernel via the synchronous commit path and a `dp4a` kernel via the async commit path, checking both results."
                ],
                "params": [],
                "returns": "`error.SmokeFailed` if any computed value mismatches its expected output.",
                "notes": [],
                "raw": "Run the CUDA Zig<->shim smoke test end to end and report PASS/FAIL.\n\nSelects the best device, then exercises the full seam: a `vadd` kernel via the\nsynchronous commit path and a `dp4a` kernel via the async commit path, checking\nboth results."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "dbg-cuda",
          "title": "Dbg Cuda",
          "section": "CUDA Runtime",
          "summary": "CUDA forward-pass debug harness for the qwen35 hybrid-SSM model. Two modes:",
          "overview": [
            "zig build cuda-dbg -- <token> [model.gguf] Per-layer residual-norm dump at pos 0 (used to pinpoint the attention gate bug: diff vs a reference implementation eval-callback `l_out-N` reference).",
            "zig build cuda-dbg -- gen <id,id,...> <ngen> [model.gguf] Autoregressive greedy generation from a prompt token-id list. Prefills the ids (exercising pos>0 RoPE + multi-entry attention + SSM state carry), then greedily emits ngen tokens. Diff GEN_IDS vs `/tmp/gen` (the reference implementation greedy) to validate the full decode path beyond pos 0.",
            "Read-only w.r.t. the engine — uses only public ForwardCuda methods."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/dbg-cuda/",
          "source_path": "src/dbg_cuda.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/dbg_cuda.zig#L408",
          "counts": {
            "code_lines": 2178,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/dbg-cuda/#main",
              "source_path": "src/dbg_cuda.zig",
              "source_line": 408,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/dbg_cuda.zig#L408",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            }
          ]
        },
        {
          "slug": "loadtest-cuda",
          "title": "Loadtest Cuda",
          "section": "CUDA Runtime",
          "summary": "Standalone load-test for src/model/loader_cuda.zig.",
          "overview": [
            "Drives only the CUDA loader path: select the best device, mmap + parse a GGUF, upload every tensor to the GPU, and report the parsed config, the tensor count, GPU free-mem before/after (to confirm ~model-size uploaded), a spot-check of 3 tensors, and a CPU embedding-row dequant. Independent of forward_cuda / gpu dispatch so the loader can be validated on its own.",
            "Rooted at src/ (module path) so it can import both model/* and cuda/* — exactly like src/main.zig. The whole thing is one Zig module, which keeps the loader's internal `../cuda/*` imports resolvable.",
            "Build + run (on the box): cd ~/zinc5090 && CUDA_HOME=/usr/local/cuda \\ ~/zig-0.15.2/zig build cuda-loadtest -Dbackend=cuda -- <model.gguf>"
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/loadtest-cuda/",
          "source_path": "src/loadtest_cuda.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/loadtest_cuda.zig#L26",
          "counts": {
            "code_lines": 93,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/loadtest-cuda/#main",
              "source_path": "src/loadtest_cuda.zig",
              "source_line": 26,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/loadtest_cuda.zig#L26",
              "doc": {
                "summary": "Load a GGUF onto the GPU via loader_cuda and print a structured report.",
                "description": [
                  "surfaces a nonzero exit on failure."
                ],
                "params": [],
                "returns": "Propagates loader errors (init/open/parse/upload) so the build step",
                "notes": [],
                "raw": "Load a GGUF onto the GPU via loader_cuda and print a structured report.\nsurfaces a nonzero exit on failure."
              },
              "members": []
            }
          ]
        },
        {
          "slug": "run-cuda",
          "title": "Run Cuda",
          "section": "CUDA Runtime",
          "summary": "Standalone CUDA greedy-decode driver for the qwen35 forward pass.",
          "overview": [
            "Loads the GGUF onto the GPU via loader_cuda, builds the forward state in src/compute/forward_cuda.zig, and runs a single greedy decode step for a fixed token, printing the predicted token id, a hidden-state sanity dump, and the top-5 logits. Independent of the gpu/ dispatch interface so the CUDA forward pass can be brought up incrementally.",
            "Rooted at src/ (module path) so it reaches both model/* and cuda/* and compute/* — exactly like src/main.zig. The whole thing is one Zig module so the loader's and forward pass's internal `../cuda/*` imports resolve.",
            "Build + run (on the box): cd ~/zinc5090 && CUDA_HOME=/usr/local/cuda \\ ~/zig-0.15.2/zig build cuda-run -Dbackend=cuda -- [token] [milestone] [model.gguf] milestone: v0 (tail only), v1 (one attn L3 + one ssm L0 + ffn), v2 (full 32 layers)"
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/run-cuda/",
          "source_path": "src/run_cuda.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/run_cuda.zig#L27",
          "counts": {
            "code_lines": 120,
            "exports": 1,
            "methods": 0,
            "symbols": 1
          },
          "symbols": [
            {
              "name": "main",
              "qualified_name": "main",
              "declaration_kind": "fn",
              "kind": "function",
              "signature": "pub fn main() !void",
              "anchor": "main",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/run-cuda/#main",
              "source_path": "src/run_cuda.zig",
              "source_line": 27,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/run_cuda.zig#L27",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": []
            }
          ]
        }
      ]
    },
    {
      "slug": "cuda-multi-tenant-serving-engine-effort-28-increment-3-3b",
      "title": "CUDA Multi-Tenant Serving Engine",
      "description": "Continuous-batching serving worker, request registry, per-token streaming channels, and GPU-owned decode loop for concurrent CUDA inference.",
      "url": "https://zolotukhin.ai/zinc/docs/zig-api#cuda-multi-tenant-serving-engine-effort-28-increment-3-3b",
      "module_count": 1,
      "symbol_count": 12,
      "modules": [
        {
          "slug": "cuda-serve",
          "title": "Cuda Serve",
          "section": "CUDA Multi-Tenant Serving Engine",
          "summary": "One GPU **worker thread** runs the continuous-batching loop (admit → prefill → `decodeBatch` → evict); many transport (HTTP) handler threads `submit` requests concurrently and **stream each request's own tokens incrementally** as the worker produces them. This is the threading model proven token-identical to N isolated single-sequence runs by the `dbg_cuda serve` harness (3a); 3b factors it into a reusable engine and adds the per-token streaming registry the HTTP/SSE transport needs.",
          "overview": [
            "ADDITIVE: the production single-sequence `decodeStep`/`prefillBatched` path is untouched. The engine REUSES `Scheduler` + `ForwardGemma.decodeBatch` (proven in increments 1+2); the only genuinely-new code here is the cross-thread result registry + the GPU worker loop.",
            "Thread-safety model (identical to the 3a proof): * ALL GPU work (`decodeBatch`, prefill) runs ONLY on the worker thread. The CUDA shim rebinds the context per call (`cuCtxSetCurrent` at every entry), so a single GPU-owning thread needs no extra ceremony. * Cross-thread mutable state = the scheduler `pending` FIFO (handlers append via `enqueue`; worker drains via `admitNext`) + the per-request channel registry. Both are guarded by ONE `mutex`. Slot state (prefill / decode / append / release) and the scratch slices are worker-only and lock-free. * Each sequence's tokens depend only on its own slot KV + position (proven isolated in increment 1), so the nondeterministic admit/interleave ORDER across handler threads cannot change any sequence's output."
          ],
          "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/",
          "source_path": "src/server/cuda_serve.zig",
          "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L42",
          "counts": {
            "code_lines": 285,
            "exports": 4,
            "methods": 8,
            "symbols": 12
          },
          "symbols": [
            {
              "name": "Forward",
              "qualified_name": "Forward",
              "declaration_kind": "const",
              "kind": "union",
              "signature": "pub const Forward = union(enum)",
              "anchor": "forward",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#forward",
              "source_path": "src/server/cuda_serve.zig",
              "source_line": 42,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L42",
              "doc": {
                "summary": "Architecture-dispatched GPU forward held by the serving engine.",
                "description": [
                  "gemma4 dense (`ForwardGemma`) and the qwen35/36 hybrid-SSM family (`ForwardCuda`) expose the SAME batched serving primitives — `decodeBatch(tokens,positions,slots,out)` and per-sequence slot-state alloc — only under different method names, so the engine drives EITHER through this thin union. Effort 28 increment 4 (qwen serving): the Scheduler / ReqChannel / worker threading are model-agnostic; only these calls differ. The forward is owned by the caller (its frame outlives the engine)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Architecture-dispatched GPU forward held by the serving engine. gemma4 dense\n(`ForwardGemma`) and the qwen35/36 hybrid-SSM family (`ForwardCuda`) expose the\nSAME batched serving primitives — `decodeBatch(tokens,positions,slots,out)` and\nper-sequence slot-state alloc — only under different method names, so the engine\ndrives EITHER through this thin union. Effort 28 increment 4 (qwen serving): the\nScheduler / ReqChannel / worker threading are model-agnostic; only these calls\ndiffer. The forward is owned by the caller (its frame outlives the engine)."
              },
              "members": []
            },
            {
              "name": "ReqChannel",
              "qualified_name": "ReqChannel",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ReqChannel = struct",
              "anchor": "req-channel",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#req-channel",
              "source_path": "src/server/cuda_serve.zig",
              "source_line": 89,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L89",
              "doc": {
                "summary": "Per-request published-token channel.",
                "description": [
                  "The handler thread that submitted the request OWNS this struct (it lives on the handler's stack/frame); the worker appends generated tokens + flips `done`/`failed` under the engine mutex and broadcasts. Registered by request id in `ServeEngine.registry`. ALL fields are touched only under `ServeEngine.mutex` (the worker may realloc `tokens` while the handler drains it, so the handler must copy out under the same lock)."
                ],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Per-request published-token channel. The handler thread that submitted the\nrequest OWNS this struct (it lives on the handler's stack/frame); the worker\nappends generated tokens + flips `done`/`failed` under the engine mutex and\nbroadcasts. Registered by request id in `ServeEngine.registry`. ALL fields are\ntouched only under `ServeEngine.mutex` (the worker may realloc `tokens` while\nthe handler drains it, so the handler must copy out under the same lock)."
              },
              "members": []
            },
            {
              "name": "Chunk",
              "qualified_name": "Chunk",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const Chunk = struct",
              "anchor": "chunk",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#chunk",
              "source_path": "src/server/cuda_serve.zig",
              "source_line": 102,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L102",
              "doc": {
                "summary": "Result of `nextChunk`: how many fresh tokens were copied into the caller's buffer and whether the stream is now fully drained.",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": "Result of `nextChunk`: how many fresh tokens were copied into the caller's\nbuffer and whether the stream is now fully drained."
              },
              "members": []
            },
            {
              "name": "ServeEngine",
              "qualified_name": "ServeEngine",
              "declaration_kind": "const",
              "kind": "struct",
              "signature": "pub const ServeEngine = struct",
              "anchor": "serve-engine",
              "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine",
              "source_path": "src/server/cuda_serve.zig",
              "source_line": 108,
              "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L108",
              "doc": {
                "summary": "",
                "description": [],
                "params": [],
                "returns": null,
                "notes": [],
                "raw": ""
              },
              "members": [
                {
                  "name": "init",
                  "qualified_name": "ServeEngine.init",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn init( allocator: std.mem.Allocator, fwd: Forward, nslots: u32, slot_ctx: u32, eos: u32, ) !ServeEngine",
                  "anchor": "serve-engine-init",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-init",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 139,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L139",
                  "doc": {
                    "summary": "Allocate slot-based per-sequence state + a scheduler with `nslots` concurrent slots, each `slot_ctx` tokens deep.",
                    "description": [
                      "The forward (`fwd`) must already be initialized; it may be EITHER a gemma or qwen forward (dispatched by `Forward`)."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Allocate slot-based per-sequence state + a scheduler with `nslots` concurrent\nslots, each `slot_ctx` tokens deep. The forward (`fwd`) must already be\ninitialized; it may be EITHER a gemma or qwen forward (dispatched by `Forward`)."
                  }
                },
                {
                  "name": "deinit",
                  "qualified_name": "ServeEngine.deinit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn deinit(self: *ServeEngine) void",
                  "anchor": "serve-engine-deinit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-deinit",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 153,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L153",
                  "doc": {
                    "summary": "",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": ""
                  }
                },
                {
                  "name": "start",
                  "qualified_name": "ServeEngine.start",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn start(self: *ServeEngine) !void",
                  "anchor": "serve-engine-start",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-start",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 160,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L160",
                  "doc": {
                    "summary": "Spawn the GPU worker thread.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Spawn the GPU worker thread."
                  }
                },
                {
                  "name": "shutdown",
                  "qualified_name": "ServeEngine.shutdown",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn shutdown(self: *ServeEngine) void",
                  "anchor": "serve-engine-shutdown",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-shutdown",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 165,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L165",
                  "doc": {
                    "summary": "Signal the worker to drain outstanding work and exit, then join it.",
                    "description": [],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Signal the worker to drain outstanding work and exit, then join it."
                  }
                },
                {
                  "name": "submit",
                  "qualified_name": "ServeEngine.submit",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn submit(self: *ServeEngine, prompt_tokens: []const u32, max_tokens: u32, chan: *ReqChannel) !u64",
                  "anchor": "serve-engine-submit",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-submit",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 178,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L178",
                  "doc": {
                    "summary": "Submit a request: register its channel, enqueue the prompt, wake the worker.",
                    "description": [
                      "The caller MUST keep `prompt_tokens` alive until the request finishes (the `Request` borrows the slice), and call `finish(id)` afterward."
                    ],
                    "params": [],
                    "returns": "the request id (used to wait/finish).",
                    "notes": [],
                    "raw": "Submit a request: register its channel, enqueue the prompt, wake the worker.\nThe caller MUST keep `prompt_tokens` alive until the request finishes\n(the `Request` borrows the slice), and call `finish(id)` afterward."
                  }
                },
                {
                  "name": "nextChunk",
                  "qualified_name": "ServeEngine.nextChunk",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn nextChunk(self: *ServeEngine, chan: *ReqChannel, dst: []u32) Chunk",
                  "anchor": "serve-engine-next-chunk",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-next-chunk",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 192,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L192",
                  "doc": {
                    "summary": "Block until fresh tokens are available for `chan` or it finishes, then copy up to `dst.len` newly-generated tokens into `dst` (all under the lock, since the worker may realloc `chan.tokens` concurrently).",
                    "description": [
                      "Returns the count copied and whether the stream is now fully drained. Loop calling this until `finished`."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Block until fresh tokens are available for `chan` or it finishes, then copy\nup to `dst.len` newly-generated tokens into `dst` (all under the lock, since\nthe worker may realloc `chan.tokens` concurrently). Returns the count copied\nand whether the stream is now fully drained. Loop calling this until\n`finished`."
                  }
                },
                {
                  "name": "finish",
                  "qualified_name": "ServeEngine.finish",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn finish(self: *ServeEngine, id: u64, chan: *ReqChannel) void",
                  "anchor": "serve-engine-finish",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-finish",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 212,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L212",
                  "doc": {
                    "summary": "Deregister + free a finished request's channel.",
                    "description": [
                      "Call once `done`/`failed` has been observed and all tokens drained."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Deregister + free a finished request's channel. Call once `done`/`failed`\nhas been observed and all tokens drained."
                  }
                },
                {
                  "name": "statsJson",
                  "qualified_name": "ServeEngine.statsJson",
                  "declaration_kind": "fn",
                  "kind": "function",
                  "signature": "pub fn statsJson(self: *ServeEngine, buf: []u8) ![]const u8",
                  "anchor": "serve-engine-stats-json",
                  "url": "https://zolotukhin.ai/zinc/docs/zig-api/cuda-serve/#serve-engine-stats-json",
                  "source_path": "src/server/cuda_serve.zig",
                  "source_line": 222,
                  "source_url": "https://github.com/zolotukhin/zinc/blob/main/src/server/cuda_serve.zig#L222",
                  "doc": {
                    "summary": "Write the cumulative throughput counters as JSON into `buf`.",
                    "description": [
                      "Lock-free (atomic loads) so `/stats` never contends the worker. The gate diffs two snapshots around each B-concurrent phase → pure decode tok/s + occupancy."
                    ],
                    "params": [],
                    "returns": null,
                    "notes": [],
                    "raw": "Write the cumulative throughput counters as JSON into `buf`. Lock-free\n(atomic loads) so `/stats` never contends the worker. The gate diffs two\nsnapshots around each B-concurrent phase → pure decode tok/s + occupancy."
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}