subblock_scoring

Derive replace-one-subblock scoring solutions from a full block library.

Functions

build_subblock_replacement_payload

Build an annotated replace-one-subblock catalog and its manifest.

build_subblock_replacement_solutions

Build deterministic solutions that each alter exactly one named subblock.

build_subblock_replacement_payload(replacement_library, teacher_block_configs)

Build an annotated replace-one-subblock catalog and its manifest.

Parameters:
  • replacement_library (dict[str, Any])

  • teacher_block_configs (Sequence[BlockConfig])

Return type:

tuple[dict[str, Any], list[dict[str, Any]]]

build_subblock_replacement_solutions(layer_replacements, teacher_block_configs)

Build deterministic solutions that each alter exactly one named subblock.

The input remains the canonical full-block library. Every distinct subblock value observed in that library is paired with teacher values for all companion subblocks. This preserves arbitrary subblock kinds and multiple named subblocks of the same kind without encoding model-family assumptions.

Parameters:
  • layer_replacements (Iterable[dict[str, Any]])

  • teacher_block_configs (Sequence[BlockConfig])

Return type:

list[dict[str, Any]]