Skip to content
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

Merge in latest upstream #102

Merged
merged 36 commits into from
May 27, 2022
Merged

Merge in latest upstream #102

merged 36 commits into from
May 27, 2022

Conversation

SquidDev
Copy link
Member

Nothing especially interesting, see the commit log for details I guess? There's a couple of nice bug fixes it'd be nice to have.

SquidDev and others added 30 commits April 29, 2022 22:35
Oh deary me.
 - Start making the summary lines for modules a little better. Just say
   what the module does, rather than "The X API does Y" or "Provides Y".
   There's still a lot of work to be done here.

 - Bundle prism.js on the page, so we can highlight non-Lua code.

 - Copy our local_ips wiki page to the main docs.
I really should have tested this. And not expected Optifine to be
normal.
This is about 5-6x faster than using a String as we don't need to
allocate and copy multiple times. In the grand scheme of things, still
vastly overshadowed by the Lua interpreter, but worth doing.
Also remove deprecated usage of DeferredWorkQueue. Oh goodness, some of
this code is so old now.

Fixes #1084
Geesh, this is nasty. Because ComputerThread is incredibly stateful, and
we want to run tests in isolation, we run each test inside its own
isolated ClassLoader (and thus ComputerThread instance).

Everything else is less nasty, though still a bit ... yuck. We also
define a custom ILuaMachine which just runs lambdas[^1], and some
utilities for starting those.

This is then tied together for four very basic tests. This is sufficient
for the changes I want to make, but might be nice to test some more
comprehensive stuff later on (e.g. timeouts after pausing).

[^1]: Which also means the ILuaMachine implementation can be changed by
other mods[^2], if someone wants to have another stab at LuaJIT :p.

[^2]: In theory. I doubt its possible in practice because so much is
package private.
 - Reset state while the server is starting rather than once it has
   started. Hopefully fixes a weird issue where wireless modems wouldn't
   be "connected" on server startup.

 - Correctly reset the MainThread metrics on server start/stop.
Previously we would compute the current timeout flags every 128
instructions of the Lua machine. While computing these flags is
_relatively_ cheap (just get the current time), it still all adds up.

Instead we now set the timeout flags from the computer monitor/watchdog
thread. This does mean that the monitor thread needs to wake up more
often[^1] _if the queue is full_, otherwise we can sleep for 100ms as
before.

This does mean that pausing is a little less accurate (can technically
take up 2*period instead). This isn't great, but in practice it seems
fine - I've not noticed any playability issues.

This offers a small (but measurable!) boost to computer performance.

[^1]: We currently sleep for scaledPeriod, but we could choose to do less.
 - Add a TOC to the Local IPs page.
 - Increase the echo delay in our speaker audio page to 1.5s. This
   sounds much better and is less clashy than 1s. Also add a
   sleep(0) (eww, I know) to fix timeouts on some browsers/computers.
 - Move Lua feature compat to a new "reference" section. Still haven't
   figured out how to structure these docs - open to any ideas really.
 - Mention FFmpeg as an option for converting to DFPWM (closes #1075).
 - Allow data-mount to override built-in files. See my comment in #1069.
We were using the size of the selectors (which is normally 1) rather
than the number of computers.
 - Parse Co-authored-by lines too. There's several contributors (mostly
   via weblate, but a few GH ones too) who weren't credited otherwise.

 - Add support for git mailmap, remapping some emails to a canonnical
   username. This allows us to remove some duplicates - nobody needs
   both SquidDev and "Jonathan Coates."

   I'm not making this file public, as it contains email addresses. This
   does mean that CI builds will still contain the full list with
   duplicates.
This is only ever defined (and called) within the ILuaMachine-specific
code. Not sure why I ever made this public.
 - Rewrap everything at 80 columns. To make this tolerable I'm using
   IDEA's language fragment support - hence the absurd line lengths.

 - Add full stops to all comments.

 - Clarify that HTTP rules are applied in-order.
 - Make assertions a little more relaxed
 - Increase timeouts of computer tests (again :D:).
 - Log where we're up to in computer tests, to make tracking stalls a
   little easier
Lemmmy and others added 6 commits May 24, 2022 22:21
Just like vanilla locking, this isn't accessible in survival.

> "im retired! im retired!!", i continue to insist as i slowly shrink
> and transform into a corn cob.
This is far less robust than block-based computers, but I don't think it
needs to be. Fixes #1097 Or closes? Unclear - I'm counting this as a
bug.
@Merith-TK Merith-TK merged commit c449b80 into mc-1.18.x/1.18.2 May 27, 2022
@SquidDev SquidDev deleted the feature/merge-upstream branch May 28, 2022 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants