2b GC follow-on: drop dead CpSharedL2NodeMetadata.{committed, committed_payload_layers}
Tier-2-GC follow-on (design §9.12 flagged vestige). The metadata's `committed`
bool and `committed_payload_layers` dict were write-only residue of the option-A
quorum the GC removed: set at construction, validated in __post_init__, copied in
split() -- but their only content/True writer was the deleted
_commit_cp_shared_l2_layers_batched. Verified tree-wide there is NO live reader
(`committed` appears only in split's `committed=self.committed` copy;
`committed_payload_layers` only in __post_init__ validation + split copy +
construction). Commit consensus under B1 is the allocator's `_committed_objects`
(MIN frontier), so `metadata.committed` was a redundant second source of truth.
CORRECTION to the original flag: `required_payloads` is NOT a vestige -- it is
LIVE (read by cache_controller.load_cp_shared_l2, the evict path hiradix:2748,
and the readback payload planning). KEPT.
Removed: the 2 dataclass fields + their __post_init__ validation + the two split()
child-copies + the cache_controller reserve-construction kwargs + 4 test
constructions/assertions. No behavior change (fields were never read). Pool suite
88/88 (syh-dev-new/torch-2.11 env) + import smoke confirm the metadata dataclass is
now {logical_len, padded_len, page_size, object_ranges, required_payloads, object_key}.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1412,8 +1412,6 @@ class HiCacheController:
|
||||
page_size=page_size,
|
||||
object_ranges=object_ranges,
|
||||
required_payloads=tuple(required_payloads),
|
||||
committed_payload_layers={payload: set() for payload in required_payloads},
|
||||
committed=False,
|
||||
object_key=object_key,
|
||||
)
|
||||
return HiCacheWriteReservation(
|
||||
|
||||
@@ -438,8 +438,6 @@ class CpSharedL2NodeMetadata:
|
||||
page_size: int
|
||||
object_ranges: dict[str, CpSharedL2ObjectRange]
|
||||
required_payloads: tuple[str, ...]
|
||||
committed_payload_layers: dict[str, set[int]]
|
||||
committed: bool = False
|
||||
object_key: str = ""
|
||||
|
||||
def __post_init__(self):
|
||||
@@ -466,13 +464,6 @@ class CpSharedL2NodeMetadata:
|
||||
f"payload_kind={object_range.payload_kind!r}"
|
||||
)
|
||||
|
||||
for payload_kind, layers in self.committed_payload_layers.items():
|
||||
self._validate_payload_kind(payload_kind)
|
||||
if not isinstance(layers, set):
|
||||
raise ValueError("committed_payload_layers values must be sets")
|
||||
if any(layer < 0 for layer in layers):
|
||||
raise ValueError("committed payload layer ids must be non-negative")
|
||||
|
||||
@staticmethod
|
||||
def _validate_payload_kind(payload_kind: str):
|
||||
if payload_kind not in _VALID_PAYLOAD_KINDS:
|
||||
@@ -533,10 +524,6 @@ class CpSharedL2NodeMetadata:
|
||||
generation=object_range.generation,
|
||||
)
|
||||
|
||||
committed_layers = {
|
||||
payload_kind: set(layers)
|
||||
for payload_kind, layers in self.committed_payload_layers.items()
|
||||
}
|
||||
return (
|
||||
CpSharedL2NodeMetadata(
|
||||
logical_len=split_len,
|
||||
@@ -544,11 +531,6 @@ class CpSharedL2NodeMetadata:
|
||||
page_size=self.page_size,
|
||||
object_ranges=parent_ranges,
|
||||
required_payloads=tuple(self.required_payloads),
|
||||
committed_payload_layers={
|
||||
payload_kind: set(layers)
|
||||
for payload_kind, layers in committed_layers.items()
|
||||
},
|
||||
committed=self.committed,
|
||||
object_key=parent_key,
|
||||
),
|
||||
CpSharedL2NodeMetadata(
|
||||
@@ -557,11 +539,6 @@ class CpSharedL2NodeMetadata:
|
||||
page_size=self.page_size,
|
||||
object_ranges=child_ranges,
|
||||
required_payloads=tuple(self.required_payloads),
|
||||
committed_payload_layers={
|
||||
payload_kind: set(layers)
|
||||
for payload_kind, layers in committed_layers.items()
|
||||
},
|
||||
committed=self.committed,
|
||||
object_key=child_key,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user