Usual arithmetic promotions (6.3.1.8) apply
...
Otherwise, if the operand that has unsigned integer type has rank greater or equal to the rank of the type of the other operand, then
the operand with signed integer type is converted to the type of the
operand with unsigned integer type.
...
and in if( s_minus_one > ui_one), s_minus_one gets converted to unsigned int.
The conversion is governed by 6.3.1.3p2:
Otherwise, if the new type is unsigned, the value is converted by
repeatedly adding or subtracting one more than the maximum value that
can be represented in the new type until the value is in the range of
the new type.
so your (unsigned int)s_minus_one will get you UINT_MAX and UINT_MAX is greater than ui_one.
On gcc and clang, you can compile with -Wsign-compare -Wconversion (or with -Wextra) to get warnings about these conversions (https://gcc.godbolt.org/z/dZ6L-y).