Skip to content

fix(config): content-key dynamic resolution when typed leaves can mutate (#4475) - #4553

Merged
Qubitium merged 1 commit into
mainfrom
fix/dynamic-config-invalidation-4475
Nov 17, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/dynamic-config-invalidation-4475

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Fixes #4475. Typed overrides such as MSEConfig are mutable plain objects, so an in-place edit (e.g. norm, grid_budget) does not advance the tracked container's mutation token. The identity+version shortcut then returned a stale deep copy on the next dynamic_get/resolve_module_config.

  • A tree that contains any untracked mutable leaf is now resolved with the content fingerprint (dataclass fields fingerprinted structurally).
  • Trees made only of tracked containers and immutable leaves keep the identity fast path.
  • The content-key decision is memoized on the tracked root and only recomputed when the container token advances.
  • An already-issued immutable snapshot still keeps its old value.

Validation

  • pytest tests/test_dynamic_config_invalidation_4475.py -q → 4 passed (edit each mutable leaf, fresh resolution sees it; issued snapshot unchanged; plain-dict control)
  • ruff check gptqmodel docs/eora tests setup.py clean

Resolves #4475.

…ate (#4475)

Typed overrides such as MSEConfig are mutable plain objects, so an in-place
edit does not advance the tracked container's mutation token. The identity
shortcut then returned a stale deep copy. Trees containing an untracked
mutable leaf now use the content fingerprint; containers of primitives keep
the identity fast path. Issued snapshots stay immutable.
@Qubitium
Qubitium merged commit 9a96f9d into main Nov 17, 2026
9 checks passed
@Qubitium
Qubitium deleted the fix/dynamic-config-invalidation-4475 branch November 17, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Fresh dynamic configuration lookups remain stale after editing mutable typed overrides

1 participant