forked from SWISDATA/processintel
ui.genetic_miner: dependent slider values are not clamped when their bounds change #30
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ffrauenberger/ProcessIntel#30
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: low (plausible: the effect depends on the Streamlit version)
Where
app/ui/genetic_miner_ui/genetic_miner_controller.py:114-134app/components/number_input_slider.py:42-66Problem
Found by code review; exact effect depends on the Streamlit version.
Some slider bounds depend on other inputs, e.g.
tournament_size ∈ [2, min(20, population_size)]. When the user lowers Population Size below the current Tournament Size, the stored value (st.session_state.tournament_size, mirrored totournament_size_text_input) is above the newmax_value, and nothing clamps it. The miner itself guards withmin(tournament_size, population_size), so the UI and the value actually used disagree.Steps to reproduce
Expected behavior
Tournament Size is clamped to 5 and the widget shows the value actually used.
Actual behavior
Depending on the Streamlit version,
number_inputraisesStreamlitValueAboveMaxError, or the widget shows a value outside its range.Fix
Clamp dependent session values in
process_algorithm_parametersbefore the widgets are created.from
issues/BUG-030-dependent-slider-bounds-not-clamped.md(code analysis of commit6bcc646, 2026-10-03)Reviewed by Codex (GPT-6) against origin/main
6bcc646eb464.Review: partially correct.
The application has no explicit dependent-value clamp, but the current reproduction needs correction. In the reviewed Nix environment (Streamlit 1.58.0), an AppTest of this helper starts Tournament Size at 10 with Population 20; reducing Population to 5 resets both tournament widgets to 2, with no exception. It does not leave 10 displayed outside the range. That still differs from the expected clamp-to-5 behavior.
Separately, pre-seeding a fresh widget with value 10 and bounds 2–5 reproduces
StreamlitValueAboveMaxErroratst.slider, beforenumber_inputis reached. Distinguish the bound-change reset behavior from an initially invalid state. The proposed explicit clamp is still reasonable.Code references: app/components/number_input_slider.py:45, app/ui/genetic_miner_ui/genetic_miner_controller.py:129.