This is an attempt to fix the hanging CI on macOS caused by some
screenshot requests being stuck unprocessed. With this change, we at
least make sure that the HTML event loop processing, which triggers
repainting, will happen as long as there are navigables that need to be
repainted.
(cherry picked from commit 72b4d44d07e12cc04bde90872e2f31aaab64aa00)
By Setting setBordered propperty on header buttons to `Yes` this
path makes the whole button clickable. Previously the only the
icon was clickable, now it's easy to click.
(cherry picked from commit af909784547c4f0ea8218ce464f45b3a1b0f4cb7)
There are a few instances where comments and documentation have minor
grammar issues likely resulting from English being the author's second
language.
This PR fixes several such cases, changing to idiomatic English and
resolving where it is unclear whether the user or program/code is
being referred to.
This avoids an unnecessary lossy conversion for the current time from
double to i32. And avoids an UBSAN failure on macOS that's dependent
on the current uptime.
(cherry picked from commit 55c1b5d1f4d7c82f0a68323260cb2e0f7de2faae,
amended to fix a typo in the commit message)
BSD `du` can also print apparent size, it just needs a different flag.
Makes `serenity.sh run` get a bit farther trying to build the disk
image on macOS without brew installed. No intended behavior change
elsewhere.
On several platforms, we don't yet have audio
support, so audio devices are missing. Instead of
having AudioServer crash repeatedly, and not
having the ability to open any app that relies on
it, we should instead handle missing devices
gracefully. This implementation is minimal, audio
device hotplugging support and such should be
implemented together with multi-device support.
AudioServer will start up and seem to function
normally without an audio device, but it will
pretend the device has a sample rate of 44.1 kHz
and all audio input is discarded.
The methods try_create_with_size() and try_create_purgeable_with_size()
on AnonymousVMObject are almost identical, other than one member
that gets set (m_purgeable). This patch makes
try_create_purgeable_with_size() call try_create_with_size() so that
both methods re-use the same code.
This avoids a segfault that would previously occur when middle clicking
to close a tab if only 1 tab was open.
(cherry picked from commit b95c05b6115c8eb84fe6fec55f5152db852fe743)
This implements the start of lossless webp's compression scheme,
which is almost, but not quite, entirely unlike deflate.
The green channel is now green-or-length, and has up to 280
entries, instead of up to 256 before. We now use the 40-entry
distance code (even though it only ever stores 1s now).
Due to this, a few places change to taking spans instead of
Array<256>s.
The spec only has the transform from prefix or distance code
to value. The inverse prefix_decompose() in this patch is
my own invention. I checked with a python script that it's
a true inverse (see PR for the script).
We now look for back-references with a distance of 1, which is
equivalent to run-length encoding. It's fairly fast to compute,
but leaves compression on the table. Full window-based
back references will be in a future PR.
We also still don't do color cache entries yet, but that should
be fairly straightforward to add. (It will make the green channel
larger than 280 entries.)
We still use a single global huffman table for the entire image.
Doing one per tile should be doable with the organization we now
have, and might also be in a future PR.
File sizes, and perf numbers on HEAD before this patch series (see
previous commit for perf comparison to previous commit):
sunset-retro.png (876K):
1.7M -> 1.6M,
25.3 ms ± 0.5 ms -> 27.5 ms ± 0.8 ms
(helps little; from 1.94x as input to 1.83x as large.
About 5% smaller, for about a 10% slowdown.)
wow.gif (nee giphy.gif) (184k):
3.9M -> 1.4M
105.7 ms ± 1.7 ms -> 74.0 ms ± 1.1 ms
(from 21.2x as big as the gif input to 7.6x as big.
About 64% smaller, for a 28% speed _up_.)
7z7c.gif (11K):
40K -> 8.4K
13.9 ms ± 0.6 ms -> 12.9 ms ± 0.5 ms
(from 3.6x as big as the gif input to 0.76x as big :^)
About 79% smaller, for a 7% speed _up_.)
We now do this in two passes instead of in one. This is virtually free
performance-wise, and allows nicer factoring.
Perf numbers after this change (see previous commit for perf numbers
before):
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 26.7 ms ± 0.8 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 14.5 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 108.2 ms ± 2.2 ms
No behavior change yet, but this will allow us to emit distance/length
and color cache symbols in addition to literal symbols.
Not super expensive perf-wise. Before:
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 25.3 ms ± 0.5 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 13.9 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 105.7 ms ± 1.7 ms
After:
Benchmark 1: image -o sunset-retro.webp sunset-retro.bmp
Time (mean ± σ): 26.1 ms ± 0.6 ms
Benchmark 1: animation -o 7z7c.webp 7z7c.gif
Time (mean ± σ): 14.4 ms ± 0.6 ms
Benchmark 1: animation -o wow.webp wow.gif
Time (mean ± σ): 106.5 ms ± 1.9 ms
Take Spans instead of Arrays. There's no need to have one copy of this
function for every possible array size passed to it.
Hardcode the inline size of the BinaryHeap to 288 for now. If this
becomes a performance issue in the future, we can make that size
an (optional) template parameter then.
No behavior change.
Works around https://gcc.gnu.org/PR70413. Without this, the next
commit would cause -Wsubobject-linkage warnings for AK/BinaryHeap.h
when used in LibCompress/Huffman.h.
We can undo this once we're on GCC 14 everywhere.
No behavior change.
VirtIO was probably broken on Windows versions of
QEMU, but this seems to no longer be the case.
Enabling VirtIO is currently required for RISC-V
mouse and keyboard support.
There are three compiler bugs that influence this decision:
- Clang writing to (validly) destroyed coroutine frame with -O0 and
-fsanitize=null,address under some conditions
(https://godbolt.org/z/17Efq5Ma5) (AK_COROUTINE_DESTRUCTION_BROKEN);
- GCC being unable to handle statement expressions in coroutines
(AK_COROUTINE_STATEMENT_EXPRS_BROKEN);
- GCC being unable to deduce template type parameter for TryAwaiter
with nested CO_TRYs (AK_COROUTINE_TYPE_DEDUCTION_BROKEN).
Instead of growing an ifdef soup in AK/Coroutine.h and
LibTest/AsyncTestCase.h, define three macros in AK/Platform.h that
correspond to these bugs and use them accordingly in the said files.
In case the user requests this, init can drop directly to a shell
without trying to spawn SystemServer.
To test this on x86-64, run:
```
Meta/serenity.sh run x86_64 GNU "init_args=emergency"
```
Also, init will drop to emergency shell if mounting filesystems with
`mount -a` failed for some reason.
This functionality can be useful in many cases.
For example, if the user needs to perform a command that must not alter
a corrupted filesystem state, then this mode is useful as the filesystem
should be mounted in read-only mode.
Another example is the ability to get a functioning system in case
SystemServer behaves badly or inconsistently, or the user specified a
wrong fstab entry, so proceeding to boot is probably a bad option.
Let's make SystemServer simpler by not involving it with the basic
system initialization sequence.
That initialization sequence can be done in another program that
theoretically can be put in another filesystem.
Co-authored-by: Tim Schumacher <timschumi@gmx.de>
If the user only wants to get the byte count of a set of files, then for
each file we can simply seek it to get the byte count instead of
iterating over all the bytes.
This is done by using a FixedStringBuffer as the foundation to perform
string formatting, which ensures that we avoid memory allocations in
the prekernel stage.
These methods do basically nothing right now, because we don't allocate
memory in the prekernel stage.
It's only here for a later commit when we bring up assertion formatting
and printing.
With this change, we no longer preallocate blocks when an inode's size
is updated, and instead only allocate the minimum amount of blocks when
the inode is actually written to.
This is a large commit, since this is essentially a complete rewrite of
the key low-level functions that handle reading/writing blocks. This is,
however, a necessary prerequisite of being able to write holes.
The previous version of `flush_block_list()` (along with its numerous
helper functions) was entirely reliant on all blocks being sequential.
In contrast to the previous implementation, the new version
of `flush_block_list()` simply writes out the difference between the old
block list and the new block list by calculating the correct indirect
block(s) to update based on the relevant block's logical index.
`compute_block_list()` has also been rewritten, since the estimated
amount of meta blocks was incorrectly calculated for files with holes as
a result of the estimated amount of blocks being a function of the file
size. Since it isn't possible to accurately compute the shape of the
block list without traversing it, we no longer try to perform such a
computation, and instead simply search through all of the allocated
indirect blocks.
`compute_block_list_with_meta_blocks()` has also been removed in favor
of the new `compute_meta_blocks()`, since meta blocks are fundamentally
distinct from data blocks due to there being no mapping between any
logical block index and the physical block index.
Since we now only store blocks that are actually allocated, it is
entirely valid for the block list to be empty, so this commit lifts the
restrictions on accessing inodes with an empty block list.
- Document exactly which crash features are available on which
architectures. There's several interesting crash tests we will want to
add for specific architectures, such as misaligned memory accesses.
- Don't compile the divide by zero crash test on RISC-V, as they simply
don't crash here.
- Rename the test for "x86 User Mode Instruction Prevention" to a more
generic "try to execute a priviledged instruction"; whatever that
specifically entails on any given architecture.
- Rename a bunch of internal variables to more generic names.
- Wrap the x86-specific implementation of "execute non executable
memory" in architecture preprocessor checks.
Both Element's and ShadowRoot's setHTMLUnsafe, and Document's static
parseHTMLUnsafe methods are implemented.
(cherry picked from commit ce8d3d17c4f2fcca8fac0ff4a832c8f50a011fc7)