AE2-UEL / Applied-Energistics-2

AE2UEL, a Fork of a Minecraft Mod about Matter, Energy and using them to conquer the world.
https://legacy.curseforge.com/minecraft/mc-mods/ae2-extended-life
Other
75 stars 74 forks source link

AE2 Export Bus Voiding Items #213

Open jude123412 opened 1 year ago

jude123412 commented 1 year ago

When I auto-craft any item, amount doesn't matter it will randomly void at least 1 item.

Describe the bug I request an item to be crafted. for instance I request to craft 7 Platinum plates from Greg Tech and only 6 items show up in my ME system. This is even more apparent when I request a Lapotronic Energy Orb from Greg Tech. The ME system also recognizes that all the items have been received and the craft finishes in the Crafting CPU.

To Reproduce Place an export bus with a fuzzy card in it. then filter any Hot ingot from Greg tech into the export bus. Have the export bus exporting into any Greg Tech Input Bus with an Ore Dictionary Filter on the same side the Export Bus is exporting into. Make the Ore Dictionary Filter Only Accept ingotHot*. Then the ME system will take random items with the name gregtech:meta_item_1 and void them, They won't end up in the Input Hatch and they leave the system

Expected behavior Auto-crafting will randomly void 1 return item when the craft has finished

Additional context This video shows what the bug does. https://user-images.githubusercontent.com/104434396/216282561-f2ed54da-cb9c-4a33-aba1-d0f461352cfc.mp4

Environment I'm using the latest AE2 Unofficial Extended Life version 0.54.20, AE2 Fluid Crafting rework mod v2.4.12 Greg tech Community Edition 1.10.2.566.

jude123412 commented 1 year ago

Ok, I have found the bug and it can be reproduced in a test world using the same versions as I have stated above. To Reproduce Place an export bus with a fuzzy card in it. then filter any Hot ingot from Greg tech into the export bus. Have the export bus exporting into any Greg Tech Input Bus with an Ore Dictionary Filter on the same side the Export Bus is exporting into. Make the Ore Dictionary Filter Only Accept ingotHot*. Then the ME system will take random items with the name gregtech:meta_item_1 and void them, They won't end up in the Input Hatch and they leave the system

PrototypeTrousers commented 1 year ago

are you exporting into a storage drawer ?

jude123412 commented 1 year ago

Im exporting them into a input bus from GregTech CE

0xC4DE commented 1 year ago

As mentioned in the linked issue, I have noticed this happening too, mainly when someone is logged out. doesn't only happen when exporting into a GTC storage bus, and happens with multiple containers, fuzzy card may or may not be related?

0xC4DE commented 1 year ago

After skimming the code I'm fairly confident the issue remains in PartExportBus.java From semantics alone, I have nailed it down to PROBABLY these lines

for (final IAEItemStack o : ImmutableList.copyOf(inv.getStorageList().findFuzzy(ais, fzMode))) {
                            this.pushItemIntoTarget(destination, energy, inv, o);
                            if (this.itemToSend <= 0) {
                                break;
                            }
                        }

However, I'm not sure if its an issue of logic or something doing something naughty.

If this happens w/o the fuzzy export bus, I would suspect there's an issue in pushItemIntoTarget, where poweredExtraction() is called, but never inserted because itemsToAdd == null for one reason or another

Alternatively it could be an issue with the tickrate modulation. Or the GridAccessAcception which... does not log errors

0xC4DE commented 1 year ago

@jude123412 Do you know if this happens without fuzzy on the export bus?

sorry for pinging on an older issue lol

jude123412 commented 1 year ago

hmmm. I have testing it with and without a fuzzy card and nothing seems to be voiding?

jude123412 commented 1 year ago

I just just re-created it in my test world and it only happens with the fuzzy card. Its a bit weird why I couldn't re-create this in a brand new world?

0xC4DE commented 1 year ago

hmmm. I have testing it with and without a fuzzy card and nothing seems to be voiding?

Thanks for the reply. Now that I think about it I don't think I have encountered that either. The only difference between the two then would be one uses findFuzzy, the problem is that that's a search only function. it then calls the results of that into pushItemIntoTarget.

My only two theories is as follows:

  1. issue in findFuzzy, where it identifies duplicate items, errors on a duplicate item, then does not insert whatever follows because it throws it out when an error is found. This could be tested by using acceleration cards, as in the error shouldn't occur when you use them (they work in batches of higher amounts)

  2. There's an issue in pushItemIntoTarget, where it will subtract the item from the system before adding it to the system and some error happens, maybe because of race conditions? This is less likely the case because the ticking seems to be a robust system. I doubt this is it because its only observed on fuzzies, which aren't the only ones to use pushItemIntoTarget.

Bonus theory that's almost definitely incorrect: These lines cause an issue where it routinely inserts 1 less than it is supposed to https://github.com/PrototypeTrousers/Applied-Energistics-2/blob/ceee1f181f3a1326edb55059d77d28e025fa263d/src/main/java/appeng/parts/automation/PartExportBus.java#L146

jude123412 commented 1 year ago

through all my testing this issue only happened to me when exporting all gregtech:meta_item_1 items into an ore dictionary filter that only allows items with the tag ingotHot. it basically allows any item with gregtech:meta_item_1 to be inserted into any container but other items with that name but not that tag will disappear.

jude123412 commented 1 year ago

hmm when I tested it without acceleration cards it would only void 1 item then it would stop but with 3 acceleration cards it kept voiding items when they entered the ae system.

0xC4DE commented 1 year ago

Does this happen with any block? or just greg meta 1

jude123412 commented 1 year ago

ok it doesn't happen with GTCEU items because all the hot ingots are gregtech:meta_ingot_hot. Just testing with GTCE.

0xC4DE commented 1 year ago

ok it doesn't happen with GTCEU items because all the hot ingots are gregtech:meta_ingot_hot. Just testing with GTCE.

Are you saying it doesn't void specifically hot ingots with oredict? if so awesome.

I was mainly talking about fuzzy export upgrade, since it likes to delete

jude123412 commented 1 year ago

it voids any item with the item id gregtech:meta_item_1.

0xC4DE commented 1 year ago

That complicates things. I have no clue what causes it...

MatthiasMann commented 1 year ago

For me this bug also happens with GTCEU using: appliedenergistics2-rv6-stable-7-extended_life-v0.55.12 gregtech-1.12.2-2.6.0-beta

My setup is an export bus with a fuzzy card into an LV input bus (no covers on the input bus, 4 empty slots) using any hot ingot as filter item and setting it to any damage. I have narrowed it down to this:

So it appears to be a race condition? when an items gets ingested by the ME system (I tried with both import bus and ME interface - both directly from an LV output bus or using an EIO conduit as an intermediary) and a fuzzy export bus is present.

jude123412 commented 1 year ago

ok that bug is even more strange because the ae2 system doesn't even complete the craft, it goes straight into the lv input bus and disappears.

jude123412 commented 1 year ago

ok this bug voids GTCEU items, the container doesn't matter. I just tested it with a minecraft chest and the item still voids...

adamsong commented 1 year ago

Seeing this bug is PO3 with agricraft seeds and cobblestone

0xC4DE commented 1 year ago

I believe one of the biggest issues is that the fuzzy card is specifically made to filter by durability and not meta tags. I dont know how that would cause it to void, but it does