mojira.dev
MC-12211

Comparator in subtraction mode does not update visually under certain conditions

Situation:
A redstone comparator in subtraction mode, fed with the same signal strength to the input (back) and one of the sides (left/right), stays visually on if the input signal turns off before the side signal does.

Steps to reproduce:
1. place a comparator
2. put it in subtraction mode
3. feed it any signal strength to the input
4. feed it the same signal strength to the left/right
5. output turns off, comparator torches stay on
(comparator "visually on" though it's not outputting any redstone signal)
6. turn off the signal to the input, output stays off, torches stay on
7. (optional) turn off the signal to the side, torches still stay on
8. (optional) remove everything except the comparator. torches still stay on

Expected behaviour:
I expected the comparator torches to turn off at (5).


Code analysis by @unknown here

Linked issues

MC-9679 Subtracting comparator input lights dont turn off when subtracting 15 then turning off input Resolved MC-11438 Comparator always on (Visual glitch) Resolved MC-15779 comprators are activated even when nothing is powering them Resolved MC-16065 Comparator is not updating Resolved MC-19499 Comparator source indication light stays on when source is turned off Resolved

Attachments

Comments 35

I didn't find that other issue... sry for duplicating.

It's fine, MC-9679 has been set as a duplicate of this one in favor of the better description. Use simple keywords next time (eg. 'comparator visual') to find similar issues easily.

i've found something very remarkable. might be usefull.

when i tried to make a up/down edge detector using a sticky piston with redstoneblock and an normal invertor, i found out that it matters which side gets powered first in substraction mode.

if i powered the left/right side, the detector would work. if i power the main input of the comparator first, it wouldn't update once the sides got update since the delay between the 2 invertors is too small for the comparator to update its state(the 2 torches stay on while they should turn off).

i use 2 repeaters for the inputs, so that the inputs are precisely equal.

i will add some pictures. i am not sure if this is a new issue, or just part of the problem in this one(it looks to me as if it could be the same).

first picture i powered the backend first (2 torches side)

seccond picture i powered the side first

as you can see the power levels are EXACTLY the same, as is the output.

but once you combine these with the 2 invertors of the last picture which do not have the same delay you can get short pulses only when the visual of the back 2 torches is turned OFF.

(it takes 1 tick more for the redstone block to update the signal after it is pushed)

the last 2 give a little last picture of how i implemented everything, i hope i've been clear enough for anyone to reproduce this complicated bug(or is it a feature?).

still an issue in 14w30b

25 more comments

Confirmed for 1.13.1.

Still confirmed for the current Snapshot 19w08b.

This bug can cause timings issues in redstone contraptions
Where the comparator thinks its on when its not, and can schedule tile ticks on itself when it shouldn't and can allow input signals to be instant
This 'instant' feature is not helpful as there are other ways to make it instant which do not affect normal gameplay and are 100% reliable
The comparator is only instant when its in the bugged on state, but after being instant it gets reset making the output seem random and unpredictable

Put the comparator in the bugged on state
Power the side input then the rear input with a signal strength less than the side
Give the comparator a block update (via another comparator, redstone dust, repeater etc)
1 redstone tick later, decrease the side signal strength to below that of the rear
The comparator then just instantly outputed the rear signal strength to the front

Observers cant detect a bugged comp turning off or on

Still happens in the latest 19w38b snapshot
The fix is super simple and doesn't break anything
I've spent many weeks rebuilding stuff, because of this bug

Wululululu

slicedlime

Confirmed

(Unassigned)

redstone, redstone-comparator, redstone-signal

Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w18c, ..., Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, 1.14.4, 19w38b, 19w40a

1.15 Pre-release 1

Retrieved