Reserved capability fields

Contents

Reserved capability fields#

The sidecar schema reserves an optional launch object for future launch-configuration metadata:

"launch": {
  "block": 256,
  "shmem_bytes": 0,
  "grid": {}
}
  • block — int (reserved: thread-block size hint)

  • shmem_bytes — int (reserved: dynamic shared-memory bytes hint)

  • grid — object (reserved: freeform grid-configuration hint)

These fields are reserved in v1: unpopulated, and the current loaders ignore them. They may be populated in a future minor revision without a ``schema_version`` bump. The schema keeps additionalProperties permissive on both the launch object and the top-level object so unknown/future keys do not fail validation of the reserved surface.

This ignore-unknown guarantee — for launch specifically, and for any unrecognized top-level sidecar/manifest key generally — is exercised by an executable test on both loaders, not just asserted in prose: eagle/python/tests/test_schema_hardening.py and eagle/tests/test_SchemaHardening.cpp. No launch hint is populated by the producer today; adding one is a deliberate design decision, not a casual addition.

Note

Do not confuse this reserved launch sidecar field with eagle’s own, unrelated idealBlockSize concept in the native CUDA-graph machinery (eagle/cuda/{Graph.h, CapturedGraph.h, Launcher.h, ComputeBlocks.h}) — a per-captured-kernel blockDim-reconciliation cap used when composing native eagle graph nodes. The two share a naming convention, not a design link.

The schema files#

manifest-v1.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/amasat01/eagle/raw/main/docs/schemas/manifest-v1.schema.json",
  "title": "EAGLE plugin deployment manifest (schema v1)",
  "description": "Frozen schema v1 for the EAGLE deployment manifest emitted by the code generator's deploy pipeline (deploy/bundle.py). A manifest describes one deployment set: an ordered list of plugin artifacts (+ their sidecars) that the C++ PluginRegistry (or the Python loaders) consume as a self-contained unit. The list order is the injection order. Validators are backward-lenient (an absent schema_version is treated as v1) and forward-strict (a schema_version newer than the loader is rejected). Unknown/future top-level keys are tolerated so a future minor revision may add keys without a schema_version bump; additionalProperties is therefore true.",
  "type": "object",
  "required": ["aether_abi", "plugins"],
  "additionalProperties": true,
  "properties": {
    "schema_version": {
      "const": 1,
      "description": "Plugin-schema version this manifest conforms to. Single-sourced from eagle.roles.SCHEMA_VERSION / plugin/roles.h::kPluginSchemaVersion. Absent ⇒ treated as v1 (backward-lenient); a value greater than the loader supports ⇒ rejected (forward-strict). Orthogonal to aether_abi."
    },
    "version": {
      "type": "integer",
      "description": "Legacy manifest-version alias (always 1). Retained for pre-freeze readers; superseded by schema_version, which the loaders read. A loader falls back to this key when schema_version is absent."
    },
    "pattern": {
      "type": "string",
      "description": "Tag naming the plugin family of the bundle. The code generator's Bundle builder emits one of the canonical values \"vector\" | \"pure\" (a Bundle is pattern-homogeneous). The Python load_manifest / C++ PluginRegistry are STRICT: an unknown OR absent pattern is rejected. It is typed as a string (not enum-constrained) so a future family can be added without a schema bump, but the current loaders accept only \"vector\" | \"pure\"."
    },
    "aether_abi": {
      "const": "aether-abi/1",
      "description": "Binary-ABI tag of the by-value GRef / HandleT POD mirrors this set was built against. Separate from and orthogonal to schema_version: it is the ABI-stable binary-layout contract. A loader rejects a mismatch before binding any by-value struct."
    },
    "plugins": {
      "type": "array",
      "description": "The set's plugin artifacts in declared (injection) order.",
      "items": { "$ref": "#/$defs/pluginEntry" }
    }
  },
  "$defs": {
    "pluginEntry": {
      "type": "object",
      "description": "One artifact in the set: its stable id, injection order, enabled flag, artifact + sidecar filenames (relative to the manifest directory), and the artifact format.",
      "required": ["id", "order", "enabled", "artifact", "sidecar", "format"],
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable, unique plugin id (from the kernel function name; duplicates get a numeric suffix)."
        },
        "order": {
          "type": "integer",
          "minimum": 0,
          "description": "Injection order == list index (the deterministic sequence in which a vector set accumulates into outVec)."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the registry loads this plugin."
        },
        "artifact": {
          "type": "string",
          "description": "Artifact filename (<id>.<ext>), relative to the manifest directory."
        },
        "sidecar": {
          "type": "string",
          "description": "Sidecar filename (<id>.json), relative to the manifest directory."
        },
        "format": {
          "enum": ["ptx", "cubin", "fatbin", "host"],
          "description": "Artifact format: arch-portable PTX, single-arch cubin, multi-arch fatbin, or host (a host shared library)."
        }
      }
    }
  }
}
sidecar-v1.schema.json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/amasat01/eagle/raw/main/docs/schemas/sidecar-v1.schema.json",
  "title": "EAGLE plugin sidecar (schema v1 to v3)",
  "description": "Schema for the per-artifact JSON sidecar a code generator writes next to a compiled kernel (v1 through v3). A sidecar describes one plugin's launch signature: a shared base plus one of two pattern-specific variants (vector | pure). arg_spec is the ordered list of [role, name] pairs a loader binds; every role must be one of the 12 canonical roles enumerated inline (plugin/roles.h::kPluginArgRoles ≡ eagle.roles.ROLES). v2 adds the execution axis (exec_targets, exec_access, exec_op) and the tag aether-abi/2; v3 is v2 with the cells record. Validators are backward-lenient (absent schema_version ⇒ v1) and forward-strict (an unknown role, or a schema_version newer than the loader, ⇒ rejected). Unknown/future top-level keys are tolerated (additionalProperties true) so a future minor revision may add keys — including populating the reserved launch surface — without a schema_version bump.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "format",
    "pattern",
    "aether_abi",
    "scalar_type",
    "kernel",
    "vector_inputs",
    "params",
    "per_sample",
    "arg_spec"
  ],
  "properties": {
    "index_planes": {
      "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "uniqueItems": true,
      "description": "Names of the input planes declared Index; they bind as int32 (a runtime converts an int64 array whose values fit). Absent = none."
    },
    "schema_version": {
      "enum": [1, 2, 3],
      "description": "Plugin-schema version this sidecar conforms to (raptor.schema.manifest.MAX_SCHEMA_VERSION is the newest). Absent ⇒ treated as v1 (backward-lenient); newer than the loader ⇒ rejected (forward-strict). Selects the aether_abi tag and whether the execution axis is carried (see the conditional blocks)."
    },
    "format": {
      "enum": ["ptx", "cubin", "fatbin", "host"],
      "description": "Artifact format the sidecar accompanies: arch-portable PTX, single-arch cubin, multi-arch fatbin, or host (a host shared library)."
    },
    "pattern": {
      "enum": ["vector", "pure"],
      "description": "Plugin family — selects the variant-specific required fields (see the conditional blocks). A loader refuses the wrong artifact family; an unknown OR absent pattern is a hard error (strict)."
    },
    "aether_abi": {
      "enum": ["aether-abi/1", "aether-abi/2"],
      "description": "Binary-ABI tag of the by-value GRef / HandleT POD mirrors the artifact was built against: aether-abi/1 with schema v1, aether-abi/2 with v2 and v3 (see the conditional blocks). A loader rejects a mismatch before binding any by-value struct."
    },
    "scalar_type": {
      "enum": ["float64", "float32", "banded"],
      "description": "Real scalar type the kernel was compiled for."
    },
    "kernel": {
      "type": "string",
      "description": "The extern-\"C\" entry-point symbol the loader resolves in the artifact: always \"raptor_kernel\", the name raptor's schema fixes for every producer, hand-written kernels included."
    },
    "vector_inputs": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Named vector inputs, in binding order (mirrors the vec_in arg_spec roles)."
    },
    "params": {
      "type": "array",
      "items": {
        "oneOf": [
          { "type": "string" },
          {
            "type": "object",
            "required": ["name", "dtype"],
            "properties": {
              "name": { "type": "string" },
              "dtype": { "enum": ["float", "int"] }
            }
          }
        ]
      },
      "description": "Named uniform scalar parameters (bound via the uniform role): bare names, or {name, dtype} entries when params_schema is 2."
    },
    "per_sample": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Named per-sample scalar inputs (bound via the per_sample role)."
    },
    "arg_spec": {
      "$ref": "#/$defs/argSpec"
    },
    "vec_widths": {
      "$ref": "#/$defs/vecWidths"
    },
    "launch": {
      "$ref": "#/$defs/launch"
    },
    "exec_targets": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": { "enum": ["device", "host"] },
      "description": "v2 and v3: the entry kinds the artifact provides."
    },
    "exec_access": {
      "enum": ["sample_local", "cross_sample_read", "cross_sample_write", "mapreduce"],
      "description": "v2 and v3: how the body touches sample-local versus cross-sample data."
    },
    "exec_op": {
      "enum": ["sum", "times", "max", "land"],
      "description": "v2 and v3: the reduction operator; present exactly when exec_access is mapreduce."
    },
    "params_schema": {
      "type": "integer",
      "description": "Wire version of the params block; 2 means decl-carrying {name, dtype} entries."
    },
    "arg_widths": { "$ref": "#/$defs/vecWidths" },
    "arg_shapes": {
      "type": "object",
      "description": "Per-name flat width of every plane-bound slot; null for a runtime-length plane.",
      "additionalProperties": { "type": ["integer", "null"] }
    },
    "arg_dtypes": {
      "type": "object",
      "description": "Per-name wire dtype of every plane-bound slot.",
      "additionalProperties": { "type": "string" }
    },
    "wide_inputs": { "$ref": "#/$defs/names" },
    "wide_outputs": { "$ref": "#/$defs/names" },
    "accum_outputs": { "$ref": "#/$defs/names" },
    "sorted_inputs": { "$ref": "#/$defs/names" },
    "dispatch": {
      "type": "array",
      "description": "Per-kernel dispatch groups: name, K, policy, static_selector and the selector's read slots.",
      "items": {
        "type": "object",
        "required": ["name", "K", "policy"],
        "additionalProperties": true,
        "properties": {
          "name": { "type": "string" },
          "K": { "type": "integer" },
          "policy": { "type": "string" },
          "static_selector": { "type": "boolean" },
          "selector_reads": { "type": "array" },
          "units": { "$ref": "#/$defs/names" }
        }
      }
    },
    "stages": {
      "type": "array",
      "description": "A split kernel: one record per stage launch, in order. A team stage carries its team record.",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "team": { "$ref": "#/$defs/team" }
        }
      }
    },
    "team_planes": {
      "type": "object",
      "description": "Scratch planes the team stages work on, by name. The runtime makes each once per kernel and lane count.",
      "additionalProperties": { "$ref": "#/$defs/teamPlane" }
    },
    "keyed": {
      "type": "object",
      "description": "The keyed planes the runtime owns between the stages of a split kernel, by name.",
      "additionalProperties": { "$ref": "#/$defs/keyedRecord" }
    },
    "quantities": {
      "type": "object",
      "description": "Per-quantity list of the wires it spans.",
      "additionalProperties": { "type": "array" }
    },
    "plane_axes": {
      "type": "object",
      "description": "Per sink declared with named axes: its payload shape and the axes it is bound over.",
      "additionalProperties": { "type": "object" }
    },
    "terminated_readonly": {
      "type": "boolean",
      "description": "Whether the kernel only reads the terminated mask."
    },
    "host_entry": {
      "type": "string",
      "description": "The host entry-point symbol, for an artifact with a host entry."
    },
    "digest": {
      "type": "string",
      "description": "Digest of the kernel body the artifact was built from."
    },
    "aether_include": {
      "type": "string",
      "description": "Provenance: the aether header root (or a sealed-payload marker) the kernel was built against."
    },
    "eagle_include": {
      "type": "string",
      "description": "Provenance: the eagle header root (or a sealed-payload marker) the kernel was built against."
    },

    "accumulate": {
      "type": "boolean",
      "description": "Vector only: whether the sink (out) uses the outVec `+=` accumulate idiom."
    },
    "sink": {
      "type": "string",
      "description": "Vector only: the accumulate sink contract name (e.g. \"outVec-scratch\") — a per-kernel deterministic-reduce scratch slot, not the final total."
    },
    "buffers": {
      "$ref": "#/$defs/buffers"
    },

    "mutables": {
      "$ref": "#/$defs/mutables"
    },
    "matrix_inputs": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Pure only, and only when the kernel has matrix inputs: the mat_in binding order (mirrors vector_inputs)."
    },
    "mat_shapes": {
      "$ref": "#/$defs/matShapes"
    },
    "derivative": {
      "type": "object",
      "description": "Optional, additive schema-v1 field (no version bump): present only for a VJP/JVP derivative artifact (autodiff, generated or custom — structurally indistinguishable). Metadata only; the artifact still launches as an ordinary pure kernel. Recompute-only in v1, so residual_policy is 'recompute' and residuals is []; a populated residuals list is a future revision that bumps schema_version and is rejected by a v1 loader.",
      "properties": {
        "kind": { "enum": ["vjp", "jvp"] },
        "primal": { "type": "string", "description": "the primal kernel's logical id" },
        "wrt": { "type": "array", "items": { "type": "string" }, "description": "the differentiated input names" },
        "residual_policy": { "const": "recompute" },
        "residuals": { "type": "array", "maxItems": 0, "description": "always empty (recompute-only)" }
      },
      "required": ["kind", "wrt", "residual_policy", "residuals"],
      "additionalProperties": true
    }
  },
  "allOf": [
    {
      "if": {
        "required": ["schema_version"],
        "properties": { "schema_version": { "enum": [2, 3] } }
      },
      "then": {
        "required": ["exec_targets", "exec_access"],
        "properties": { "aether_abi": { "const": "aether-abi/2" } },
        "if": { "required": ["exec_access"], "properties": { "exec_access": { "const": "mapreduce" } } },
        "then": { "required": ["exec_op"] },
        "else": { "not": { "required": ["exec_op"] } }
      },
      "else": {
        "properties": { "aether_abi": { "const": "aether-abi/1" } },
        "not": {
          "anyOf": [
            { "required": ["exec_targets"] },
            { "required": ["exec_access"] },
            { "required": ["exec_op"] }
          ]
        }
      }
    },
    {
      "if": {
        "required": ["pattern"],
        "properties": { "pattern": { "const": "vector" } }
      },
      "then": {
        "required": ["accumulate", "sink", "vec_widths", "buffers"]
      }
    },
    {
      "if": {
        "required": ["pattern"],
        "properties": { "pattern": { "const": "pure" } }
      },
      "then": {
        "required": ["mutables", "vec_widths", "buffers"]
      }
    }
  ],
  "$defs": {
    "role": {
      "description": "The 12 canonical arg-spec roles. Single source of truth: plugin/roles.h::kPluginArgRoles ≡ eagle.roles.ROLES (cross-checked by python/tests/test_roles_vocab.py). A loader rejects any role outside this set at LOAD time (forward-strict). Note: mat_in is a valid role recognized by every loader, but the reference C++ host inject() does not pack matrix arguments (a CUDA-backend capability).",
      "enum": [
        "out",
        "vec_in",
        "mat_in",
        "per_sample",
        "lookup",
        "mutable",
        "terminated",
        "uniform",
        "nsamples",
        "wide_in",
        "wide_out",
        "accum_out"
      ]
    },
    "argSpec": {
      "type": "array",
      "description": "Ordered list of [role, name] pairs (role FIRST) the loader binds in sequence.",
      "items": {
        "type": "array",
        "minItems": 2,
        "maxItems": 2,
        "prefixItems": [
          { "$ref": "#/$defs/role" },
          { "type": "string", "description": "The argument name (a vector_input / param / per_sample / mutable / buffer name, or a fixed slot name such as \"out\"/\"terminated\"/\"nsamples\")." }
        ],
        "items": false
      }
    },
    "names": {
      "type": "array",
      "items": { "type": "string" }
    },
    "vecWidths": {
      "type": "object",
      "description": "Per-name vector width (component count) so a host can allocate (W, N) buffers; the GRef struct itself is width-independent. Present on both variants.",
      "additionalProperties": { "type": "integer" }
    },
    "buffers": {
      "type": "array",
      "description": "Declared read-only lookup buffers (the consolidation contract). Present on both variants. May be empty.",
      "items": { "$ref": "#/$defs/buffer" }
    },
    "buffer": {
      "type": "object",
      "description": "One read-only lookup buffer the registry uploads once at consolidation and binds by value as a flat handle.",
      "required": ["name", "kind", "dtype", "shape", "count"],
      "additionalProperties": true,
      "properties": {
        "name": { "type": "string" },
        "kind": { "const": "lookup" },
        "dtype": { "const": "float" },
        "shape": {
          "type": "array",
          "items": { "type": "integer" },
          "description": "Buffer dimensions."
        },
        "count": {
          "type": "integer",
          "description": "Flat element count == prod(shape)."
        }
      }
    },
    "mutables": {
      "type": "array",
      "description": "Pure only: the writable per-sample state that IS the pure output.",
      "items": { "$ref": "#/$defs/mutable" }
    },
    "mutable": {
      "type": "object",
      "description": "One writable per-sample slot. dtype/width let a loader rebuild which Mutables ride the (W, N) GRef ABI vs a flat scalar handle; the optional default fills an omitted Mutable. A matrix slot additionally carries its (R, C) shape.",
      "required": ["name", "dtype", "width"],
      "additionalProperties": true,
      "properties": {
        "name": { "type": "string" },
        "dtype": {
          "enum": ["scalar", "float", "int", "int32", "uint32", "vector", "matrix"],
          "description": "Element kind of the mutable."
        },
        "width": {
          "type": "integer",
          "description": "Flat component count (1 for a scalar)."
        },
        "prior": {
          "type": "boolean",
          "description": "The body reads this slot's launch-start value, so the host must preserve it between launches."
        },
        "default": {
          "type": ["number", "null"],
          "description": "Scalar fill value for an omitted mutable (null when none)."
        },
        "shape": {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": { "type": "integer" },
          "description": "The (R, C) shape — present ONLY when dtype == \"matrix\" (the flat width alone cannot be un-flattened)."
        }
      },
      "if": {
        "properties": { "dtype": { "const": "matrix" } },
        "required": ["dtype"]
      },
      "then": {
        "required": ["shape"]
      }
    },
    "matShapes": {
      "type": "object",
      "description": "Pure only, and only when the kernel has matrix inputs: the (R, C) shape per matrix-input name.",
      "additionalProperties": {
        "type": "array",
        "minItems": 2,
        "maxItems": 2,
        "items": { "type": "integer" }
      }
    },
    "launch": {
      "type": "object",
      "description": "Launch configuration. `block`, `box`, `lane_space`, `index_set` and `local_*` are populated; `shmem_bytes` and `grid` stay reserved (loaders ignore them). Keys are added without a schema_version bump. additionalProperties is true so unknown/future launch keys do not fail validation.",
      "additionalProperties": true,
      "dependentRequired": {
        "local_bytes": ["local_source", "local_limit"],
        "local_source": ["local_bytes", "local_limit"],
        "local_limit": ["local_bytes", "local_source"]
      },
      "properties": {
        "block": {
          "type": "integer",
          "minimum": 1,
          "description": "The exact number of threads per block the artifact was emitted for. Required for an artifact that uses a thread/block box; the loader launches with it verbatim."
        },
        "box": {
          "type": "object",
          "description": "A thread box: each thread computes T lanes that differ only along lane axis `axis`, `stride` flat lanes apart. A launch of n lanes runs ceil(n / (T * stride)) * stride threads, and the launch's base and count count threads while the lane count stays n.",
          "required": ["axis", "T", "stride"],
          "additionalProperties": false,
          "properties": {
            "axis": { "type": "integer", "minimum": 0, "description": "Position of the boxed axis in lane_space.axes." },
            "T": { "type": "integer", "minimum": 2, "description": "Lanes per thread." },
            "stride": { "type": "integer", "minimum": 1, "description": "Flat-lane distance between two lanes of one box's axis step." }
          }
        },
        "index_set": {
          "type": "object",
          "description": "A kernel over an index set: width is the bits of the lane-number map; the prefix form has no map and names in count the one-element plane holding how many leading lanes run.",
          "required": ["width"],
          "additionalProperties": false,
          "properties": {
            "width": { "enum": [32, 64] },
            "prefix": { "type": "boolean" },
            "count": { "type": "string", "minLength": 1 }
          },
          "if": { "required": ["prefix"], "properties": { "prefix": { "const": true } } },
          "then": { "required": ["count"], "properties": { "width": { "const": 32 } } },
          "else": { "not": { "required": ["count"] } }
        },
        "local_bytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Local memory one thread holds. Comes with local_source and local_limit."
        },
        "local_source": {
          "enum": ["ptxas", "ptx"],
          "description": "Where local_bytes was read: ptxas (the stack frame of a CUBIN) or ptx (the declared depots, a ceiling)."
        },
        "local_limit": {
          "type": "integer",
          "minimum": 1,
          "description": "The device's per-thread local memory limit, in bytes."
        },
        "shmem_bytes": {
          "type": "integer",
          "description": "Reserved: dynamic shared-memory bytes hint."
        },
        "grid": {
          "type": "object",
          "additionalProperties": true,
          "description": "Reserved: freeform grid-configuration hint (shape TBD)."
        },
        "lane_space": {
          "type": "object",
          "description": "The logical shape of the kernel's flat sample axis. axes is row-major and the LAST axis is the fastest; memory stays the flat n = product of the extents. Only the first axis may have a null extent (known at run time); every later extent is fixed. label is null for an unlabeled axis; non-null labels are unique. group is the compaction unit: a lane count, 1 by default.",
          "required": ["axes", "group"],
          "additionalProperties": false,
          "properties": {
            "axes": {
              "type": "array",
              "minItems": 1,
              "prefixItems": [ { "$ref": "#/$defs/laneAxis" } ],
              "items": {
                "allOf": [
                  { "$ref": "#/$defs/laneAxis" },
                  { "properties": { "extent": { "type": "integer" } } }
                ]
              }
            },
            "group": { "type": "integer", "minimum": 1 }
          }
        }
      }
    },
    "keyedRecord": {
      "type": "object",
      "description": "A keyed plane: width payload entries over the kept lane axes; payload is the shape of one key's payload.",
      "required": ["width", "axes"],
      "additionalProperties": false,
      "properties": {
        "width": { "type": "integer", "minimum": 1 },
        "axes": {
          "type": "array",
          "items": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "prefixItems": [
              { "type": ["string", "null"] },
              { "type": ["integer", "null"], "minimum": 1 }
            ],
            "items": false
          }
        },
        "payload": { "type": "array", "items": { "type": "integer", "minimum": 1 } }
      }
    },
    "team": {
      "type": "object",
      "description": "A team stage. grid says what a block is: a lane (the default), a key of a block sum (keys, with keyed), or in an ordered scatter into the plane named by of, a chunk of lanes (chunks, with status) or a cell of that plane (targets).",
      "required": ["threads"],
      "additionalProperties": false,
      "properties": {
        "threads": { "type": "integer", "minimum": 1 },
        "grid": { "enum": ["lanes", "keys", "chunks", "targets"] },
        "keyed": { "$ref": "#/$defs/keyedRecord" },
        "of": { "type": "string", "minLength": 1 },
        "status": { "type": "string", "minLength": 1 }
      },
      "allOf": [
        {
          "if": { "required": ["grid"], "properties": { "grid": { "const": "keys" } } },
          "then": { "required": ["keyed"], "not": { "anyOf": [ { "required": ["of"] }, { "required": ["status"] } ] } }
        },
        {
          "if": { "required": ["grid"], "properties": { "grid": { "const": "chunks" } } },
          "then": { "required": ["of", "status"], "not": { "required": ["keyed"] } }
        },
        {
          "if": { "required": ["grid"], "properties": { "grid": { "const": "targets" } } },
          "then": { "required": ["of"], "not": { "anyOf": [ { "required": ["keyed"] }, { "required": ["status"] } ] } }
        },
        {
          "if": { "not": { "required": ["grid"] } },
          "then": { "not": { "anyOf": [ { "required": ["keyed"] }, { "required": ["of"] }, { "required": ["status"] } ] } }
        },
        {
          "if": { "required": ["grid"], "properties": { "grid": { "const": "lanes" } } },
          "then": { "not": { "anyOf": [ { "required": ["keyed"] }, { "required": ["of"] }, { "required": ["status"] } ] } }
        }
      ]
    },
    "teamPlane": {
      "type": "object",
      "description": "One scratch plane of a team stage: per_lane elements of dtype for each lane, or for each key (keys), each chunk-by-cell pair of the plane per_target, or once for the whole run (once). fill is what the plane holds at the start of every run.",
      "required": ["dtype", "per_lane"],
      "additionalProperties": false,
      "properties": {
        "dtype": { "enum": ["real", "int32"] },
        "per_lane": { "type": "integer", "minimum": 1 },
        "keys": { "$ref": "#/$defs/keyedRecord" },
        "per_target": { "type": "string", "minLength": 1 },
        "once": { "const": true },
        "fill": { "type": "integer" }
      },
      "not": {
        "anyOf": [
          { "required": ["keys", "per_target"] },
          { "required": ["keys", "once"] },
          { "required": ["per_target", "once"] }
        ]
      }
    },
    "laneAxis": {
      "type": "object",
      "required": ["label", "extent"],
      "additionalProperties": false,
      "properties": {
        "label": { "type": ["string", "null"] },
        "extent": { "type": ["integer", "null"], "minimum": 1 }
      }
    }
  }
}