Repository navigation
build(idian): ratchet the target onto the conversion groups (#2625) - #2966
Conversation
shared/qt/idian joins the ratchet: naming the three groups in its own target_compile_options() surfaces nine implicit conversions in components/ToggleSwitch.cpp.hpp's blendColors(), which the next commit states at the call sites.
With the three groups on, the idian unity TU reports nine implicit conversions, all in ToggleSwitch.cpp.hpp's blendColors(): the int channels widened into the float blend and the result narrowed back to int per channel. blendChannel() states both conversions once; the arithmetic and the final truncation are unchanged.
|
Handed off to the coordinator.
|
|
Handed off to the coordinator. CI is green apart from the sanitizer lane, which is queued behind master's in-progress Sanitizers dispatch; auto-merge is on. The slice's local evidence and the RED/GREEN SHAs are in the description. Rebase/lint fixups and re-queueing after an ejection are the coordinator's. |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review — the ratchet slice is correct, one verification note.
Correctness. I re-derived the equivalence rather than taking the body's word for it: the old expression was int * (1 - ratio) + int * ratio, where 1 - ratio promotes to float, so every term was already computed in float and only the assignment narrowed. blendChannel() states the same widening (static_cast<float>(from) * (1.0f - ratio)) and blendColors() states the same truncating narrowing (static_cast<int>), so the returned QColor is unchanged for every input, including ratio outside [0,1] and the clamp-free case.
Flag scope. shared/qt/idian tracks only .cpp/.hpp (30 .hpp, 1 .cpp, plus CMakeLists.txt), so naming the three groups for COMPILE_LANG_AND_ID:CXX alone is the right scope; there are no C or Objective-C inputs to cover.
Mechanical state. ci/conversion_ratchet.py reads the entry from this CMakeLists.txt itself, so this PR also selects its own asan lane (#2923) — the Sanitize 🧪 / asan job is the only check still running, and I will queue the PR when it passes.
Tiers that do not apply are correctly stated: value-preserving casts on a UI colour helper, no Rust unit, no C test, no protocol or runtime behaviour change. docs/features.md is not the ledger for build tooling.
No change requested.
Slice of the conversion ratchet (#2625):
shared/qt/idianopts into-Wconversion,-Wsign-conversionand-Wfloat-conversion, and the ninediagnostics that surfaces are stated at the call site.
RED —
47c86a1b6shared/qt/idian/CMakeLists.txtnames the three groups for C++. Replaying thetarget's
shared/qt/idian/build/idian.core+.hpp.cppunity TU with the global-Wno-*pins removed reports 9 implicit conversions, all incomponents/ToggleSwitch.cpp.hpp:ToggleSwitch.cpp.hpp:25-27intchannel ->floatin the1 - ratioblendToggleSwitch.cpp.hpp:25-27float-> theintchannelWhat changed —
af0fb5bf6blendChannel(int from, int to, float ratio)states the widening once andblendColors()casts the one narrowing back toint. The arithmetic is thesame float expression and the narrowing is the same truncation, so the colour
returned is bit-identical to before; no flag, pin or target behaviour changes.
GREEN evidence
Replay of the same compdb entries against this branch:
(the whole
shared/qt/tree, not justidian, is clean with the groups on).Local:
gersemi 0.25.0 -con the editedCMakeLists.txtok,clang-format --dry-run --Werroron the edited source ok,uv run python -m unittest test_conversion_ratchet test_frontend_conversion_optins test_ci_scope(63 tests) ok from
ci/,./lint->== lane lint: ok.Tiers that do not apply: no Rust unit, no C test, no protocol or runtime
behaviour change (a pure UI colour helper).
Refs #2625