Commit graph

36078 commits

Author SHA1 Message Date
Frank Denis
3c647ca6bb
crypto.ml_kem: avoid redundant assignment & fix K-PKE.KeyGen (#26031)
FIPS-203 algorithm 13 for deterministic key generation uses
(𝜌, 𝜎) ← G(𝑑 ‖ 𝑘) , not (𝜌, 𝜎) ← G(k ‖ d)
2025-11-24 18:45:48 +00:00
Ryan Liptak
289f2f0d34
Merge pull request #17541 from moosichu/fix/wine-get-final-path-name-by-handle
Windows: Deal with NT namespaced paths in GetFinalPathNameByHandle
2025-11-24 07:17:30 -08:00
Andrew Kelley
66fe584ead README: update some links 2025-11-24 06:39:28 -08:00
Ryan Liptak
ccc5e581a8
Merge pull request #26030 from squeek502/windows-cleanup
Cleanup some Windows stuff, delete unused functions and kernel32 bindings
2025-11-24 06:14:21 -08:00
Ryan Liptak
bf25816067 Move Windows rename implementation from std.posix to windows.RenameFile
This also unifies the rename implementations, since previously `posix.renameW` used `MoveFileEx` while `posix.renameatW` used `NtOpenFile`/`NtSetInformationFile`. This, in turn, allows the `MoveFileEx` bindings to be deleted as `posix.renameW` was the only usage.
2025-11-23 23:38:01 -08:00
Ryan Liptak
17ecc77fc4 os.windows: Delete unused functions and kernel32 bindings 2025-11-23 23:38:01 -08:00
Alex Rønne Petersen
b31173179b
ci: bump riscv64-linux-release timeout to 8 hours on Forgejo Actions 2025-11-24 06:29:53 +01:00
Ryan Liptak
d48faf1a32 windows.GetFinalPathNameByHandle: add links to bugs tracking the Wine workaround 2025-11-23 19:10:23 -08:00
fkobi
9082b004b6 README: use HTTPS for releases.llvm.org 2025-11-23 20:54:20 +01:00
meowjesty
755a3d957c
langref: convert to unmanaged ArrayList in example 2025-11-23 18:32:05 +00:00
Justus Klausecker
e5c2df9f17 std.math.big.int: fix format functions 2025-11-23 09:52:43 -08:00
Alex Rønne Petersen
16fc083f2b
std.Target: remove Abi.code16
This functionality -- if it's actually needed -- can be reintroduced through
some other mechanism. An ABI is clearly not the right way to represent it.

closes #25918
2025-11-23 10:22:03 +01:00
Matthew Lugg
6d543bcf94
Merge pull request #23733 from alichraghi/bp
replace @Type with individual type-creating builtins
2025-11-23 07:50:29 +00:00
Alex Rønne Petersen
0a9f666ea6
cbe: translate sparc ccr/icc/xcc registers to icc
C compilers do not distinguish between these.
2025-11-23 07:27:50 +01:00
Alex Rønne Petersen
1231aa9719
Revert "std.os.linux.sparc64: use icc instead of xcc in asm clobbers"
This reverts commit b34a13da38.

This is not the right fix; rather, the C backend needs to translate all of ccr,
icc, and xcc to just icc.
2025-11-23 07:27:45 +01:00
Kendall Condon
8284da2f3d flate.Compress: simplify huffman node comparisons
Instead of comparing each field, nodes are now compared as 32-bit
values where `freq` is in the most significant bits.
2025-11-22 22:11:33 -08:00
Alex Rønne Petersen
d6931b0ff5
test: disable coff_dwarf on FreeBSD
https://github.com/ziglang/zig/issues/25471

This is not the only test that aborts like this, nor does it happen only on
FreeBSD, but it happens to be disproportionally disruptive on FreeBSD in
particular.
2025-11-23 07:10:35 +01:00
Frank Denis
0e3b5e6d8f blake3: remove unnecessary comptime, digest_length instead of key_length 2025-11-22 22:09:51 -08:00
Andrew Kelley
9473011052 README: add some content from the wiki
also update the issue templates
2025-11-22 16:01:02 -08:00
Ali Cheraghi
dec1163fbb
all: replace all @Type usages
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-22 22:42:38 +00:00
Matthew Lugg
ce0df033cf
stage1: update zig1.wasm
Signed-off-by: Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-22 22:42:37 +00:00
Matthew Lugg
c5383173a0
compiler: replace @Type with individual type-creating builtins
The new builtins are:
* `@EnumLiteral`
* `@Int`
* `@Fn`
* `@Pointer`
* `@Tuple`
* `@Enum`
* `@Union`
* `@Struct`

Their usage is documented in the language reference.

There is no `@Array` because arrays can be created like this:

    if (sentinel) |s| [n:s]T else [n]T

There is also no `@Float`. Instead, `std.meta.Float` can serve this use
case if necessary.

There is no `@ErrorSet` and intentionally no way to achieve this.
Likewise, there is intentionally no way to reify tuples with comptime
fields, or function types with comptime parameters. These decisions
simplify the Zig language specification, and moreover make Zig code more
readable by discouraging overly complex metaprogramming.

Co-authored-by: Ali Cheraghi <alichraghi@proton.me>
Resolves: #10710
2025-11-22 22:42:37 +00:00
Andrew Kelley
3f2cf1c002 CI: skip test-incremental on Windows
Tracked by #22510
2025-11-22 08:09:25 -08:00
Andrew Kelley
c9a788c851 Revert "disable flaky test/incremental/add_decl"
This reverts commit d54fbc0123.

Since all incremental tests are flaky on Windows, this is reinstated and
all test-incremental tests will be skipped on Windows until the
flakiness is resolved.

Closes #26003
2025-11-22 08:09:12 -08:00
Alex Rønne Petersen
48b0eef3e9
mark resinator and translate-c as vendored in .gitattributes 2025-11-22 13:45:20 +01:00
Ryan Liptak
21f9f378f1 Reader.defaultDiscard: Fix for use with an indirect reader
If a Reader implementation implements `stream` by ignoring the Writer, writing directly to its internal buffer, and returning 0, then `defaultDiscard` would not update `seek` and also return 0, which is incorrect and can cause `discardShort` to violate the contract of `VTable.discard` by calling into `vtable.discard` with a non-empty buffer.

This commit fixes the problem by advancing seek up to the limit after the stream call. This logic could likely be somewhat simplified in the future depending on how #25170 is resolved.
2025-11-21 22:34:55 -08:00
Ryan Liptak
822f412424 fs.path: Fix on big-endian architectures, make PathType.isSep assume WTF-16 is LE
This commit flips usage of PathType.isSep from requiring the caller to convert to native to assuming the input is LE encoded, which is a breaking change. This makes usage a bit nicer, though, and moves the endian conversion work from runtime to comptime.
2025-11-21 22:26:58 -08:00
Andrew Kelley
2ea55d7153
Merge pull request #25998 from ziglang/std.Io.Threaded-async-guarantee
std.Io: guarantee when async() returns, task is already completed or has been successfully assigned a unit of concurrency
2025-11-21 20:56:29 -08:00
Andrew Kelley
d828115dab
Merge pull request #25903 from aznashwan/minor-docs-fixes
docs: minor fixes to main language reference page.
2025-11-21 19:56:15 -08:00
Andrew Kelley
7096e66ca9 std.Thread: update doc comments 2025-11-21 19:54:41 -08:00
Andrew Kelley
eb038ffbc1 std.Io.Threaded: forward cancellation requests to awaited tasks 2025-11-21 19:54:41 -08:00
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
Nashwan Azhari
af7dec94c6
docs: use custom error set in values.zig sample.
Signed-off-by: Nashwan Azhari <aznashwan@icloud.com>
2025-11-22 02:56:40 +02:00
Nashwan Azhari
153521279f
docs: remove normal-doc comment interleaving bug note.
Signed-off-by: Nashwan Azhari <aznashwan@icloud.com>
2025-11-22 02:51:16 +02: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
Tom Read Cutting
689032d571 Deal with NT paths in GetFinalPathNameByHandle
When calling QueryObjectName, NT namespaced paths can be returned. This
change appropriately strips the prefix to turn it into an absolute path.

(The above behaviour was observed at least in Wine so far)

Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2025-11-21 01:52:50 -08:00