-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit WireLib.TriggerInput to avoid stack overflow #2457
Conversation
Now, same as WireLib.TriggerOutput, WireLib.TriggerInput has a limit of being called 4 times a tick to avoid stack overflows. This fixes wiremod#2415
Sounds like this could break some stuff. Why not just fix whatever's outputting too much. |
It didn't seem to break anything but ofc I didn't test any dupes or anything. I don't see how this would break stuff either, I don't think anything should be triggering the same input more than four times a tick. But I have two other options:
|
We could try this out on CFC for a week or so. We get a lot of E2 activity. Would that be helpful? |
That would be nice, I think it's fine as it is right now, just need to make sure it doesn't break stuff like Sparky said (which I don't think it would, why would any wire components rely on being executed 4+ times in a single tick? Maybe digiscreens? But you can't even trigger outputs more than 4 times a tick so I dunno how inputs would be triggered faster intentionally.) |
I think it looks good too. I'll use this branch on CFC for a few days and let you know if I see any errors that might be related 👍 |
We've been running this for about three days now. ~2,400 E2s were spawned in that time, and the only wiremod error I've seen is the holoemitter bug that I fixed in another PR. We've also received no bug reports since swapping over. I'd say this PR is good to go 👍 |
Yeah I was thinking it's fine, although the issue would likely be with niche wire components that might somehow rely on this behavior. Going to merge anyway, thank you |
Right - E2s was the only metric I could get, haha. I figure it's a decent measure of how much use wiremod generally saw during that period. No problem |
Now, same as
WireLib.TriggerOutput
,WireLib.TriggerInput
has a limit of being called 4 times a tick (for each input) to avoid stack overflows.This fixes #2415