Skip to content

Remove the unused AssetConfig from EngineState #952

Description

@coghex

Background

Engine.Asset.Types defines an AssetConfig record with four settings:

  • acMaxTextureAtlases
  • acMaxShaderPrograms
  • acPreloadAssets
  • acEnableHotReload

defaultEngineState constructs it positionally as:

AssetConfig 100 100 True True

and stores it in EngineState.assetConfig.

A complete search across src/, app/, test/, and test-headless/ finds no
read or update of assetConfig or any of its four selectors. The declarations
and default construction are their only occurrences. Git history likewise shows
introduction and relocation of the fields, but no implementation of the
advertised limits, preloading, or hot reload.

The live renderer uses separate mechanisms such as
BindlessConfig.bcMaxTextures, FontCache, and AssetPool; none consult
AssetConfig. The texture-infrastructure design document still describes hot
reload as an undecided future workflow rather than an implemented setting.

The dead record therefore advertises capabilities that do not exist, and its
positional construction makes the four unexplained literals particularly
misleading.

assetConfig is also recorded in two authoritative state documents:

  • docs/persistence_state_inventory.md classifies it as excluded and rebuilt at
    boot.
  • docs/engineenv_capability_inventory.md names it as part of
    main-render-private EngineState.

Those inventories must remain synchronized with the live record.

Requirements

  1. Remove AssetConfig and its four field selectors from
    Engine.Asset.Types.
  2. Remove EngineState.assetConfig and its default construction.
  3. Remove imports or other source references made unnecessary by that deletion.
  4. Update docs/persistence_state_inventory.md so its EngineState inventory
    exactly matches the remaining live fields.
  5. Update docs/engineenv_capability_inventory.md so its descriptions of
    EngineState no longer name AssetConfig.
  6. Preserve the existing main-render-thread ownership invariant for
    EngineState.
  7. Preserve all live asset loading, texture limits, font caching, shader
    handling, rendering, and scene-management behavior.
  8. Do not change save data or increment the save version; this field is
    currently excluded from persistence and has never carried runtime state.

Acceptance

  • No declaration, construction, inventory row, or source reference remains:
! rg -n \
  '\b(AssetConfig|assetConfig|acMaxTextureAtlases|acMaxShaderPrograms|acPreloadAssets|acEnableHotReload)\b' \
  src app test test-headless \
  docs/persistence_state_inventory.md \
  docs/engineenv_capability_inventory.md
  • Production and both test targets compile warning-clean:
cabal build lib:synarchy exe:synarchy \
  synarchy-test-headless synarchy-test-graphical \
  --ghc-options=-Werror
  • Both affected inventory contracts remain valid:
python3 tools/persistence_inventory_audit.py
python3 tools/engine_env_capability_audit.py
  • The patch contains no whitespace errors:
git diff --check

No behavioral test is required for deleting fields with no readers.

Out of scope

  • Implementing atlas or shader-program caps, asset preloading, filesystem
    watching, or hot reload.
  • Changing BindlessConfig, AssetPool, FontCache, ShaderProgram, or the
    live texture/font pipelines.
  • Removing other unused asset types or registries.
  • Changing the EngineEnv field set, RenderCapability, or the
    engineStateRef capability boundary.
  • Changing persistence behavior or the save format.
  • Folding in Remove unused legacy fields from EngineConfig #932's separate EngineConfig cleanup.

Related

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomersreviewed:approveCLI review verdict: approvetech-debtCode cleanup: stale comments, dead code, diverged duplicates, inconsistencies

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions