Commit graph

35990 commits

Author SHA1 Message Date
Andrew Kelley
b052afd24b std.Io.Threaded: import std.mem.Alignment 2025-11-21 19:54:41 -08:00
Andrew Kelley
cf744aa182 std.Io.Threaded: slightly different semantics
while still preserving the guarantee about async() being assigned a unit
of concurrency (or immediately running the task), this change:
* retains the error from calling getCpuCount()
* spawns all threads in detached mode, using WaitGroup to join them
* treats all workers the same regardless of whether they are processing
  concurrent or async tasks. one thread pool does all the work, while
  respecting async and concurrent limits.
2025-11-21 19:54:41 -08:00
Andrew Kelley
13b537d77c std.Io.Threaded: remove dead code 2025-11-21 19:54:41 -08:00
Andrew Kelley
aae85a4130 std.Io.Threaded: allow calling init in single-threaded mode 2025-11-21 19:54:41 -08:00
Andrew Kelley
b4ec78906c std.Io: update async documentation to reflect the guarantee 2025-11-21 19:54:41 -08:00
Loris Cro
69f9395b38 fix logic bug in groupAsync 2025-11-21 19:54:41 -08:00
Loris Cro
ff883dd6ce fix single-threaded builds 2025-11-21 19:54:41 -08:00
Loris Cro
8eaebf5939 Io.Threaded PoC reimplementation
This is a reimplementation of Io.Threaded that fixes the issues
highlighted in the recent Zulip discussion. It's poorly tested but it
does successfully run to completion the litmust test example that I
offered in the discussion.

This implementation has the following key design decisions:

- `t.cpu_count` is used as the threadpool size.
- `t.concurrency_limit` is used as the maximum number of
  "burst, one-shot" threads that can be spawned by `io.concurrent` past
  `t.cpu_count`.
- `t.available_thread_count` is the number of threads in the pool that
  is not currently busy with work (the bookkeeping happens in the worker
  function).
- `t.one_shot_thread_count` is the number of active threads that were
  spawned by `io.concurrent` past `t.cpu_count`.

In this implementation:

- `io.async` first tries to decrement `t.available_thread_count`. If
  there are no threads available, it tries to spawn a new one if possible,
  otherwise it runs the task immediately.
- `io.concurrent` first tries to use a thread in the pool same as
  `io.async`, but on failure (no available threads and pool size limit
  reached) it tries to spawn a new one-shot thread. One shot threads
  run a different main function that just executes one task, decrements
  the number of active one shot threads, and then exits.

A relevant future improvement is to have one-shot threads stay on for a
few seconds (and potentially pick up a new task) to amortize spawning
costs.
2025-11-21 19:54:41 -08:00
Andrew Kelley
d54fbc0123 disable flaky test/incremental/add_decl
tracked by https://github.com/ziglang/zig/issues/26003
2025-11-21 19:53:33 -08:00
Andrew Kelley
bb3b5d09cc Revert std.crypto kangarootwelve addition
I would like a chance to review this before it lands, please. Feel free
to submit the work again without changes and I will make review
comments.

In the meantime, these reverts avoid intermittent CI failures, and
remove bad patterns from occurring in the standard library that other
users might copy.

Revert "std.crypto: improve KT documentation, use key_length for B3 key length (#25807)"

This reverts commit 4b593a6c24.

Revert "crypto - threaded K12: separate context computation from thread spawning (#25793)"

This reverts commit ee4df4ad3e.

Revert "crypto.kt128: when using incremental hashing, use SIMD when possible (#25783)"

This reverts commit bf9082518c.

Revert "Add std.crypto.hash.sha3.{KT128,KT256} - RFC 9861. (#25593)"

This reverts commit 95c76b1b4a.
2025-11-21 19:43:01 -08:00
Alex Rønne Petersen
a892e09435
Revert "ci: allow riscv64-linux on Forgejo Actions to run on PRs for now"
This reverts commit 2cdafe9106.
2025-11-22 03:08:49 +01:00
Alex Rønne Petersen
d3e20e71be
std.zig.system.linux: implement s390x native CPU detection 2025-11-21 12:15:15 +01:00
Alex Rønne Petersen
1cd913a0ec
std.zig.system: disable vector support on s390x for now
https://github.com/llvm/llvm-project/issues/168992
2025-11-21 12:15:15 +01:00
Alex Rønne Petersen
7e54ee06d8
test: disable big simd vector C ABI test on s390x 2025-11-21 12:15:15 +01:00
Alex Rønne Petersen
3333bcc4f2
std.crypto.ml_kem: disable some tests on s390x with vector support 2025-11-21 12:15:15 +01:00
Alex Rønne Petersen
47df2f9abe
std.zig.system.linux: don't arbitrarily limit sparc CPU detection to 64-bit 2025-11-21 12:15:15 +01:00
Alex Rønne Petersen
534370c4de
ci: bump loongarch64-linux-debug timeout to 4 hours on Forgejo Actions 2025-11-21 09:44:22 +01:00
Alex Rønne Petersen
f3eef35c05
aro: unbreak s390x
https://github.com/ziglang/zig/pull/25780#discussion_r2548496117
2025-11-21 06:28:19 +01:00
rpkak
6b4f45f782 system specific errno 2025-11-20 15:03:23 -08:00
Benjamin Jurk
4b5351bc0d
update deprecated ArrayListUnmanaged usage (#25958) 2025-11-20 14:46:23 -08:00
Andrew Kelley
db622f14c4
Merge pull request #25780 from Vexu/translate-c
Update Aro and translate-c to latest
2025-11-20 10:24:31 -08:00
Matthew Lugg
8a73fc8d8e
Merge pull request #25981 from mlugg/macos-fuzz-2
make the fuzzer vaguely work on macOS
2025-11-20 17:48:35 +00:00
Andrew Kelley
a9568ed296
Merge pull request #25898 from jacobly0/elfv2-progress
Elf2: more progress
2025-11-20 04:33:04 -08:00
Veikka Tuominen
df50f9e28e update resinator to Aro changes 2025-11-20 13:12:53 +02:00
Veikka Tuominen
21f3ff2a8d update Aro and translate-c to latest 2025-11-20 13:12:53 +02:00
Matthew Lugg
a87b533231
std.Io.Writer: fix some bugs 2025-11-20 10:42:21 +00:00
Matthew Lugg
b05fefb9c9
std.http: stop assuming previous chunk state
The full file may not be written, either due to a previous chunk being
in-progress when `sendFile` was called, or due to `limit`.
2025-11-20 10:42:21 +00:00
Matthew Lugg
bc524a2b1a
std.Build: fix crashes running fuzz tests 2025-11-20 10:42:21 +00:00
Matthew Lugg
0f06b5b583
std.debug.MachOFile: handle 'path/to/archive.a(entry.o)' form 2025-11-20 10:42:21 +00:00
Matthew Lugg
e1fa4011fb
fuzz: hack around unknown module structure 2025-11-20 10:42:20 +00:00
Matthew Lugg
010dcd6a9b
fuzzer: account for runtime address slide
This is relevant to PIEs, which are notably enabled by default on macOS.
The build system needs to only see virtual addresses, that is, those
which do not have the slide applied; but the fuzzer itself naturally
sees relocated addresses (i.e. with the slide applied). We just need to
subtract the slide when we communicate addresses to the build system.
2025-11-20 10:42:20 +00:00
Matthew Lugg
0a330d4f94
std.debug.Info: basic Mach-O support 2025-11-20 10:42:20 +00:00
Matthew Lugg
0caca625eb
std.debug: split up Mach-O debug info handling
Like ELF, we now have `std.debug.MachOFile` for the host-independent
parts, and `std.debug.SelfInfo.MachO` for logic requiring the file to
correspond to the running program.
2025-11-20 10:42:20 +00:00
Jacob Young
7b325e08c9 Elf2: revert incorrect endian fix 2025-11-19 22:19:57 -05:00
Alex Rønne Petersen
f06adc70b0
ci: bump timeout for s390x-linux-debug to 5 hours on Forgejo Actions 2025-11-20 03:34:42 +01:00
Alex Rønne Petersen
c9afa901f3
ci: bump timeout for s390x-linux-release to 4 hours on Forgejo Actions 2025-11-19 23:47:58 +01:00
Alex Rønne Petersen
5078acf3a3
std.Io.net: disable listen on a unix socket, send bytes, receive bytes on Windows
https://github.com/ziglang/zig/issues/25983
2025-11-19 21:51:57 +01:00
Alex Rønne Petersen
4ed5bb0bac
ci: bump aarch64-linux-debug timeout to 3 hours on Forgejo Actions 2025-11-19 20:45:36 +01:00
Harold
2f240d0819 std.Build.Step.Compile: add support for '-z defs' flag 2025-11-19 20:13:54 +01:00
Jan200101
bd832ed39a std.Io.Threaded: add missing statx masks
statx does not guarantee that the values requested by the mask be
present and those not requested be absent which is why this worked.
2025-11-19 20:13:25 +01:00
Alex Rønne Petersen
43371cf388
Merge pull request #25965 from alexrp/s390x
`s390x-linux` and general big-endian stuff
2025-11-19 19:52:18 +01:00
Matthew Lugg
806470b492
compiler: fix crash if file contents change during update
When reporting a compile error, we would load the new file, but assume
we could apply old AST/token indices (etc) to it, potentially causing
crashes. Instead, if the file stat has changed since it was loaded, just
emit an error that the file was modified mid-update.
2025-11-19 09:44:22 +00:00
Alex Rønne Petersen
abd05b3819
ci: enable s390x-linux jobs on Forgejo Actions 2025-11-19 09:41:58 +01:00
Alex Rønne Petersen
830831dcba
ci: add s390x-linux scripts 2025-11-19 09:41:55 +01:00
Alex Rønne Petersen
e11901c1a1
test: enable C ABI tests on s390x-linux 2025-11-19 01:42:45 +01:00
Alex Rønne Petersen
692c798303
test: disable a bunch of failing C ABI tests on s390x 2025-11-19 01:42:45 +01:00
Alex Rønne Petersen
ae0cc8c065
test: disable C ABI tests using i128 on s390x due to an LLVM crash
https://github.com/llvm/llvm-project/issues/168460
2025-11-19 01:42:45 +01:00
Alex Rønne Petersen
a8e77b7a05
test: disable test-link on big-endian hosts
https://github.com/ziglang/zig/issues/25961
2025-11-19 01:42:45 +01:00
Alex Rønne Petersen
a0e6d41331
test: remove complex arithmetic testing from c_compiler standalone test
This has no business being here. Tests for our compiler-rt routines should be in
compiler-rt, and tests for our C ABI compliance should be in `test-c-abi`.
2025-11-19 01:42:45 +01:00
Alex Rønne Petersen
41f7f3d4d5
test: disable an error trace test on optimized s390x-linux 2025-11-19 01:42:45 +01:00