<!-- 
RSS generated by JIRA (9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13) at Sat Jan 11 15:02:20 UTC 2025

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Mojang Studios Jira</title>
    <link>https://bugs.mojang.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en</language>    <build-info>
        <version>9.12.2</version>
        <build-number>9120002</build-number>
        <build-date>10-01-2024</build-date>
    </build-info>


<item>
            <title>[MCPE-14075] Strange nondeterminism in horizontal hopper pipes and their cooldown counter</title>
                <link>https://bugs.mojang.com/browse/MCPE-14075</link>
                <project id="10200" key="MCPE">Minecraft (Bedrock codebase)</project>
                    <description>&lt;p&gt;I&apos;m not sure what is really going on but I have to report this anyway. In the screenshot below, when you put a stack of items into the topmost chest, everything should go to the bottommost chest and the middle one should not receive any items. But in 0.14.1 the middle chest &lt;b&gt;does&lt;/b&gt; receive some of items, and the number of those items randomly changes every time you try.&lt;br/&gt;
&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;115584_thumb&quot; href=&quot;https://bugs.mojang.com/secure/attachment/115584/115584_horizontal-hopper-cooldown.png&quot; title=&quot;horizontal-hopper-cooldown.png&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;115584&quot; file-preview-title=&quot;horizontal-hopper-cooldown.png&quot;&gt;&lt;img src=&quot;https://bugs.mojang.com/secure/thumbnail/115584/_thumb_115584.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;However, if you instead place the topmost chest directly on top of the second hopper (i.e. the one on the left side of the middle chest), all the items in the chest go to the bottommost chest as expected. So this has something to do with hoppers&apos; cooldown counter. I mean, it is as if there were a relatively small chance that the second hopper didn&apos;t get suspended by the first hopper pushing items into it. It&apos;s like a nondeterminism of a multithreaded program.&lt;/p&gt;

&lt;p&gt;This relates to now-fixed &lt;a href=&quot;https://bugs.mojang.com/browse/MCPE-13417&quot; title=&quot;Item travel very slow when using hoppers.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MCPE-13417&quot;&gt;&lt;del&gt;MCPE-13417&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
            <key id="139094">MCPE-14075</key>
            <summary>Strange nondeterminism in horizontal hopper pipes and their cooldown counter</summary>
                <type id="1" iconUrl="https://bugs.mojang.com/secure/viewavatar?size=xsmall&amp;avatarId=18903&amp;avatarType=issuetype">Bug</type>
                                    <status id="5" iconUrl="https://bugs.mojang.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                            <reporter username="depressed-pho">PHO</reporter>
                        <labels>
                            <label>hopper</label>
                            <label>redstone</label>
                    </labels>
                <created>Sun, 10 Apr 2016 17:09:51 +0200</created>
                <updated>Sat, 4 Nov 2023 05:33:08 +0100</updated>
                            <resolved>Fri, 3 Feb 2017 09:43:51 +0100</resolved>
                                    <version>0.14.0</version>
                    <version>0.14.1</version>
                    <version>0.14.2</version>
                    <version>0.14.3</version>
                    <version>0.15.0</version>
                    <version>0.15.2</version>
                    <version>0.16.0</version>
                    <version>0.16.2</version>
                    <version>1.0.0.7</version>
                    <version>1.0.0</version>
                                    <fixVersion>1.0.3</fixVersion>
                                                        <votes>20</votes>
                                    <watches>22</watches>
                                                                            <comments>
                            <comment id="354670" author="talaeus" created="Tue, 17 Jan 2017 13:25:42 +0100"  >&lt;p&gt;I finally found and fixed the issue. It will be available soon (tm).&lt;/p&gt;</comment>
                            <comment id="351221" author="candlemaster666" created="Wed, 28 Dec 2016 09:36:12 +0100"  >&lt;p&gt;Still a problem in Windows 10 edition 1.0.0.&lt;/p&gt;</comment>
                            <comment id="340379" author="handlbar.rick@comcast.net" created="Fri, 4 Nov 2016 21:46:03 +0100"  >&lt;p&gt;Confirmed still an issue in Windows 10 Edition 0.16.0.&lt;br/&gt;
In the similar arrangement shown in the 3rd attachment image, items placed in the top chest will all end up in the bottom chest. Items placed in the chest on the left side end up about 60/40 in the bottom and right chests respectively. I found I can get it to behave properly by disabling the left hopper 5 ticks out of 6. &lt;/p&gt;</comment>
                            <comment id="338728" author="papadax" created="Fri, 28 Oct 2016 17:26:24 +0200"  >&lt;p&gt;Still an issue in 0.16&lt;/p&gt;</comment>
                            <comment id="333480" author="jjewett27" created="Thu, 6 Oct 2016 06:26:00 +0200"  >&lt;p&gt;confirmed for 0.15.10- hopper item sorters are unreliable because sometimes they do not pull in items properly. Also with 2 hoppers facing each other, and multiple items, it should theoretically send 1 item back and forth however sometimes an extra one is pushed seemingly randomly&lt;/p&gt;</comment>
                            <comment id="318902" author="aksansai" created="Sat, 2 Jul 2016 00:11:44 +0200"  >&lt;p&gt;Confirmed this to still be an issue in 0.15.0.  This breaks all manners of the way hoppers are supposed to deliver items based on the &quot;tick&quot;.&lt;/p&gt;</comment>
                            <comment id="307982" author="witherboss2000" created="Sat, 28 May 2016 00:20:04 +0200"  >&lt;p&gt;Confirmed: iPad v0.14.3&lt;/p&gt;</comment>
                            <comment id="299973" author="depressed-pho" created="Wed, 13 Apr 2016 18:45:56 +0200"  >&lt;p&gt;Yes, it was a tiled set of item sorters that made me aware of this unreliability. I suspect that they changed the &quot;push&quot; action of hoppers so that source hoppers reset the cooldown counter of destination hoppers only when the latter is zero in order to work around &lt;a href=&quot;https://bugs.mojang.com/browse/MCPE-13417&quot; title=&quot;Item travel very slow when using hoppers.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MCPE-13417&quot;&gt;&lt;del&gt;MCPE-13417&lt;/del&gt;&lt;/a&gt;. It&apos;s true &lt;a href=&quot;https://bugs.mojang.com/browse/MCPE-13417&quot; title=&quot;Item travel very slow when using hoppers.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MCPE-13417&quot;&gt;&lt;del&gt;MCPE-13417&lt;/del&gt;&lt;/a&gt; can be &quot;fixed&quot; that way but it&apos;s a wrong thing to do, and that resulted in this glitch. The correct behavior of a hopper would be to:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Decrement its cooldown counter if it&apos;s non-zero.&lt;/li&gt;
	&lt;li&gt;Check if it&apos;s disabled (i.e. being powered or adjacent to a powered solid opaque). If so, wait for the next game tick and return to the step one.&lt;/li&gt;
	&lt;li&gt;Check if it can suck item entities above it. If so, suck them all at once regardless of the cooldown counter (&lt;a href=&quot;https://bugs.mojang.com/browse/MCPE-13891&quot; title=&quot;Hoppers suck item entities only one at a time&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MCPE-13891&quot;&gt;&lt;del&gt;MCPE-13891&lt;/del&gt;&lt;/a&gt;).&lt;/li&gt;
	&lt;li&gt;Check if its cooldown counter is zero. If not, wait for the next game tick and return to the step one.&lt;/li&gt;
	&lt;li&gt;Check if it can push an item to the destination. If so, push it and reset its own counter to 8. And if the destination is another hopper, reset the destination&apos;s counter to 8 as well.&lt;/li&gt;
	&lt;li&gt;Check if it can pull an item from a container above. If so, pull it and reset its own counter to 8. (Do nothing special even if the container in question is in fact another hopper.)&lt;/li&gt;
	&lt;li&gt;Wait for the next game tick and return to the step one.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;And it&apos;s very important to follow all of these steps atomically. If two hoppers were doing these in an interleaved way, they would end up in this nondeterminism, e.g. hoppers whose counter is reset to 8 may continue to push/pull items due to a race condition. Of course you cannot use pessimistic locking to synchronize hoppers because that would result in a dead lock when there is a hopper loop.&lt;/p&gt;

&lt;p&gt;(As a side note, some people believe that hoppers pull before push but I think that&apos;s incorrect. If in doubt, try placing a single hopper pointing sideways and use two chests as an input and output. If hoppers pull then push in the same game tick, you can&apos;t observe items passing through the hopper by measuring with a comparator or watching its inventory.)&lt;/p&gt;</comment>
                            <comment id="299953" author="jjan" created="Wed, 13 Apr 2016 17:17:07 +0200"  >&lt;p&gt;I confirm the hoppers don&apos;t perform reliable on the iOS 0.14.1 version. If you put items in a chain of hoppers, it seems some hoppers are skipped (if you keep monitoring them, no items seem to flow through. seemingly they jump to the end hopper immediately). I experimented with several item sorters, and of a full stack of items only the first item is sucked into the hopper below, the rest moves on. I build a loop of hoppers in an item sorting system and first I thought every loop it would suck one item in the hopper below, but doing several test runs, the results were everytime different and therefor could not be reproduced reliable. The more items are in the hoppers, the worse it gets. I also tried a huge sorting system, with the same item in every hopper below the main chain of hoppers, hoping that every hopper would suck 1 item of the stack, but again only the first hopper would suck 1 item and the rest would pass over all the other hoppers. Unable to reproduce reliable test results, gives me the feeling it is a multithreaded part of the code. Hope it helps.&lt;/p&gt;

&lt;p&gt;I believe several  reported issues are related to this problem or are duplicates&lt;/p&gt;</comment>
                            <comment id="299928" author="depressed-pho" created="Wed, 13 Apr 2016 14:39:23 +0200"  >&lt;p&gt;While experimenting with the &quot;item counter&quot; shown below, I found another strange phenomenon which is very likely to be tied to the issue.&lt;br/&gt;
&lt;span class=&quot;image-wrap&quot; style=&quot;&quot;&gt;&lt;a id=&quot;115701_thumb&quot; href=&quot;https://bugs.mojang.com/secure/attachment/115701/115701_item-counter.jpg&quot; title=&quot;item-counter.jpg&quot; file-preview-type=&quot;image&quot; file-preview-id=&quot;115701&quot; file-preview-title=&quot;item-counter.jpg&quot;&gt;&lt;img src=&quot;https://bugs.mojang.com/secure/thumbnail/115701/_thumb_115701.png&quot; style=&quot;border: 0px solid black&quot; role=&quot;presentation&quot;/&gt;&lt;/a&gt;&lt;/span&gt;&lt;br/&gt;
This &quot;counter&quot; transfers items in the chest &lt;em&gt;Ca&lt;/em&gt; to &lt;em&gt;Cb&lt;/em&gt; with emitting 4 tick on-pulse for each single item passes through it... at least in theory. Every time the hopper &lt;em&gt;Ha&lt;/em&gt; receives an item, it suspends the hopper &lt;em&gt;Hb&lt;/em&gt; until &lt;em&gt;Ha&lt;/em&gt; pushes the item into &lt;em&gt;Cb&lt;/em&gt; and becomes empty.&lt;/p&gt;

&lt;p&gt;I put 64 items into &lt;em&gt;Ca&lt;/em&gt; and observed the pulses it emits. The result was very surprising. The first item stayed for 8 game ticks (4 redstone ticks) in &lt;em&gt;Ha&lt;/em&gt; as expected. But things started to go mad after that. For the 2nd to the 64th items, they either&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Stayed for only 1 redstone tick in &lt;em&gt;Ha&lt;/em&gt;, &lt;b&gt;or&lt;/b&gt;&lt;/li&gt;
	&lt;li&gt;Teleported from &lt;em&gt;Hb&lt;/em&gt; to &lt;em&gt;Cb&lt;/em&gt; without any observable delay.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Both cases are glitchy because every time &lt;em&gt;Hb&lt;/em&gt; pushes an item to &lt;em&gt;Ha&lt;/em&gt;, it should reset the cooldown counter of both &lt;em&gt;Hb&lt;/em&gt; and &lt;em&gt;Ha&lt;/em&gt; to 8 so the items should always stay in &lt;em&gt;Ha&lt;/em&gt; for 8 game ticks. The only difference between the first item and the rest is that whether the cooldown counter of &lt;em&gt;Ha&lt;/em&gt; is 0 or 2 (not 4 due to &lt;a href=&quot;https://bugs.mojang.com/browse/MCPE-12848&quot; title=&quot;Comparators measuring a container take redstone 2 ticks to change their state instead of 1&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MCPE-12848&quot;&gt;&lt;del&gt;MCPE-12848&lt;/del&gt;&lt;/a&gt;). So it might be that &lt;em&gt;Hb&lt;/em&gt; was resetting the counter of &lt;em&gt;Ha&lt;/em&gt; &lt;em&gt;only when it was 0&lt;/em&gt;, which was the source of the problem.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10102">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="140129">MCPE-14318</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10103">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="186177">MCPE-28890</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="518728">MCPE-163477</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="134044">MCPE-13417</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="127675" name="Minecraft_ Windows 10 Edition Beta 11_4_2016 2_42_58 PM.png" size="877207" author="Auldrick" created="Fri, 4 Nov 2016 20:23:10 +0100"/>
                            <attachment id="115584" name="horizontal-hopper-cooldown.png" size="1285270" author="depressed-pho" created="Sun, 10 Apr 2016 17:09:51 +0200"/>
                            <attachment id="115701" name="item-counter.jpg" size="280149" author="depressed-pho" created="Wed, 13 Apr 2016 14:39:23 +0200"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_11500" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>ADO</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23106</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10701" key="com.atlassian.jira.plugin.system.customfieldtypes:datetime">
                        <customfieldname>CHK</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 29 Dec 2016 04:37:00 +0100</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10500" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Confirmation Status</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10303"><![CDATA[Confirmed]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11700" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10402" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Platform</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10111"><![CDATA[Tablet - iOS - iPad 3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11600" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i07ydz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    </customfields>
    </item>
</channel>
</rss>