Option instance and default analysis has several unguarded edge cases
closedOpened by MelanX on
Original description
By MelanX · October 23, 2026Crate: tools/minecraft-options
Commit: 2b2af1e4f8166d02e4732d19e040a53745d97a51
Behavior
Latent defects in the OptionInstance and default handling; none changes current data.
classify_value_setreturns{"kind": "int_range"}with no min/max (a text match), andanalyse_option_windowthen readsvalue_set["min"]and raisesKeyError.double_rangedefaults to 0.0..1.0 withdomain_confidence: high.OptionInstance$IntRangeBaseandSliderableEnumare classifiedunit_double.- Every
Codec.xmapthat is not arithmetic (xmap(Enum::byId, Enum::getId)) setsxmap_unresolved, soao,attackIndicator,narrator,particles,graphicsMode,chatVisibility, andprioritizeChunkUpdatescarry "persisted codec transforms the value through an xmap this analyzer could not read". With several xmaps in one window the value comes from the last resolved one while unresolved stays set. apply_opsreturns a float for every field, so the JVM-default candidate forI/Jfields is0.0, and it returns early on a division by zero without applying the remaining operations. Unknown ops are ignored.ephervex_manageableis true fortype == "unknown"that is not a SPECIAL key, andtype_confidencebecomes high when a SPECIAL key's unknown type is rewritten tospecial.defaulthas no unit marker. Legacy and field-access records store file-space values (fov 0.0 for 1.12.2 to 1.18.2), while OptionInstance records store UI-space values (fov 70), both high.
Expected behavior
Unresolved structure is reported as unresolved with correct confidence, missing bounds do not raise, and a default declares its value space.
Impact
A future numeric xmap would be indistinguishable from the current enum noise, and a consumer comparing defaults across releases misreads fov.
Locations
tools/minecraft-options/analyze_options.pyclassify_value_set(1133-1143),analyse_option_window(1265-1271, 1393-1435),apply_ops(1580-1594),build_setting(2154)
Validation and limitations
Reproduced with synthetic windows and the cached fov records for 1.18.2 and 1.19.1. The KeyError was not triggered by any cached JAR.