36058 Commits

Author SHA1 Message Date
Giuseppe Cesarano
5c0309a9e5
std.posix: implemented getpid and getppid 2025-11-07 08:52:35 +01:00
Frank Denis
4b593a6c24
std.crypto: improve KT documentation, use key_length for B3 key length (#25807)
It was not obvious that the KT128/KT256 customization string can be
used to set a key, or what it was designed to be used for at all.

Also properly use key_length and not digest_length for the BLAKE3
key length (no practical changes as they are both 32, but that was
confusing).

Remove unneeded simd_degree copies by the way, and that doesn't need
to be in the public interface.
2025-11-07 08:20:04 +01:00
marximimus
2e8f8afc83
Base64DecoderWithIgnore.calcSizeUpperBound cannot return an error (#25834)
* std: Base64DecoderWithIgnore.calcSizeUpperBound cannot return an error

* std: update doc comment of Base64DecoderWithIgnore.calcSizeUpperBound
2025-11-07 08:16:34 +01:00
David Rubin
483f9bd367
llvm: add extra clobbers to valgrind requests
This seems to work around a very puzzling miscompilation first
present in LLVM 21.x. We already unconditionally add these
clobbers to inline assembly that came from the source, the
valgrind requests should also contain them.
2025-11-06 20:27:38 -08:00
David Rubin
09e4035e79
llvm: clobber rdx instead of edx for x86-64 valgrind request 2025-11-06 20:12:35 -08:00
David Rubin
71988d6719
Io.net: set receive{,Timeout} message to init
If we use `undefined`, then `netReceive` can `@intCast` the
control slice len to msghdr controllen, which is sometimes `u32`,
even on 64-bit platforms.

`init` just avoids this entirely by setting `control` to an empty
slice rather than undefined.
2025-11-06 17:44:28 -08:00
David Rubin
654a5b20d7
Io: fix compile error in receive and receiveTimeout
Correctly uses the `netReceive` API. If an error was
returned, we propagate that error, otherwise assert
we only received one message.
2025-11-06 17:42:19 -08:00
Mateusz Poliwczak
40132af3ad std.zig.AstRlAnnotate: remove pointless switch
This switch has the same cases as the outer one.
2025-11-06 23:57:16 +00:00
Ryan Liptak
4937aeff84
Merge pull request #25714 from snoire/enum-literal-format-support
std.Io.Writer.print: support .enum_literal in 't' format specifier
2025-11-06 14:40:34 -08:00
Mateusz Poliwczak
b2895f356f std.ArrayList: actaully memset to undefined in shrinkRetainingCapacity and clearRetainingCapacity
See #25810
2025-11-06 05:30:41 -08:00
Alex Rønne Petersen
e639602569 ci: update to Wasmtime 38.0.3 2025-11-06 14:08:16 +01:00
Ryan Liptak
e0898f4e05 Step.Run: Fix for convertPathArg when cwd and path args are on different drives
Fixes #25805
2025-11-06 03:40:33 -08:00
snoire
b4b54b597d test: add test case for enum-literal with '{t}' format
Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
2025-11-06 13:45:21 +08:00
snoire
ffb0050d81 std.Io.Writer.print: support .enum_literal in 't' format specifier 2025-11-06 13:45:21 +08:00
Mateusz Poliwczak
416bf1de47 std.ArrayList: memset to undefined in shrinkRetainingCapacity and clearRetainingCapacity
Fixes #25796
2025-11-05 19:31:19 -08:00
skewb1k
26db54d69b zig fmt: fix extra whitespace in StructInit with multiline strings
68d2f68ed introduced special handling for StructInit fields
containing multiline strings to prevent inserting whitespace after =.
However, this logic didn't handle cases without a trailing comma,
which resulted in unwanted trailing whitespace.
2025-11-05 14:07:30 +02:00
Jacob Young
a6d444c271 x86_64: implement split vector stores
Closes #25809
2025-11-04 22:45:54 -05:00
Carl Åstholm
54f2a7c833 Move std.Target.SubSystem to std.zig.Subsystem
Also updates the field names to conform with the rest of std.
2025-11-05 01:31:26 +01:00
Carl Åstholm
075d300342 Remove std.builtin.subsystem
The subsystem detection was flaky and often incorrect and was not
actually needed by the compiler or standard library. The actual
subsystem won't be known until at link time, so it doesn't make
sense to try to determine it at compile time.
2025-11-05 01:29:00 +01:00
Alex Rønne Petersen
74900e938a
Merge pull request #25813 from linusg/bump-macos-libc
libc: Update macOS headers to SDK 26.1
2025-11-04 23:05:14 +01:00
Linus Groh
f55eb18abb libc: Add mach-o/getsect.h and mach/exception.h macOS headers
Closes #18257.
2025-11-04 21:51:48 +00:00
Linus Groh
e2fb103ce1 libc: Add all macOS CommonCrypto headers
Closes #23795.
2025-11-04 21:48:06 +00:00
Linus Groh
abca5bd588 libc: Update macOS headers to SDK 26.1 2025-11-04 21:40:21 +00:00
Jacob Young
459f3b7ede codegen: fix tuple padding
Closes #25797
2025-11-04 06:04:30 -05:00
Jacob Young
ea76946d2a Io.Queue: fix empty and full states being indistinguishable. 2025-11-04 04:24:32 -05:00
kbz_8
c603d27f90
Fixing SPIR-V header generator magic + Adding Zig compiler version to SPIR-V OpSource (#25435)
* fixing Zig generator magic in SPIR-V header; adding zig compiler version to SPIR-V OpSource

* Update src/codegen/spirv/Module.zig

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>

---------

Co-authored-by: rpkak <67059904+rpkak@users.noreply.github.com>
2025-11-04 04:40:29 +00:00
Frank Denis
ee4df4ad3e
crypto - threaded K12: separate context computation from thread spawning (#25793)
* threaded K12: separate context computation from thread spawning

Compute all contexts and store them in a pre-allocated array,
then spawn threads using the pre-computed contexts.

This ensures each context is fully materialized in memory with the
correct values before any thread tries to access it.

* kt128: unroll the permutation rounds only twice

This appears to deliver the best performance thanks to improved cache
utilization, and it’s consistent with what we already do for SHA3.
2025-11-03 17:09:00 +01:00
Linus Groh
afdd04356c std: serenity has preadv now
2a9154e77c
2025-11-02 14:45:32 -08:00
Frank Denis
bf9082518c
crypto.kt128: when using incremental hashing, use SIMD when possible (#25783)
Also add plain kt128 (without threading) to the benchmarks
2025-11-02 11:31:00 +01:00
Alex Rønne Petersen
2f4bca41ea
ci: bump riscv64-linux-debug timeout to 9 hours on Forgejo Actions 2025-11-01 17:18:24 +01:00
Jacob Young
143ea88017 Revert "std.http: disable failing test on 32-bit arm"
This reverts commit 16185f66f1e500d61d43550e7c847a36ad1032df.

Which was fixed by d000574380baba7b63fdcde713b51f8318509474.

Closes #25762
2025-11-01 11:21:28 -04:00
Alex Rønne Petersen
5db9eaa851
std.Io.Threaded: use ResetEventPosix on illumos
Like NetBSD, illumos has no futexes.

ref #25760
2025-11-01 16:18:56 +01:00
Bingwu Zhang
a8fea09cd5 cbe: fix more MIPS register names in inline assembly 2025-11-01 15:11:35 +01:00
Frank Denis
95c76b1b4a
Add std.crypto.hash.sha3.{KT128,KT256} - RFC 9861. (#25593)
KT128 and KT256 are fast, secure cryptographic hash functions based on Keccak (SHA-3).

They can be seen as the modern version of SHA-3, and evolution of SHAKE, with better performance.

After the SHA-3 competition, the Keccak team proposed these variants in 2016, and the constructions underwent 8 years of public scrutiny before being standardized in October 2025 as RFC 9861.

They uses a tree-hashing mode on top of TurboSHAKE, providing both high security and excellent performance, especially on large inputs.

They support arbitrary-length output and optional customization strings.

Hashing of very large inputs can be done using multiple threads, for high throughput.

KT128 provides 128-bit security strength, equivalent to AES-128 and SHAKE128, which is sufficient for virtually all applications.

KT256 provides 256-bit security strength, equivalent to SHA-512. For virtually all applications, KT128 is enough (equivalent to SHA-256 or BLAKE3).

For small inputs, TurboSHAKE128 and TurboSHAKE256 (which KT128 and KT256 are based on) can be used instead as they have less overhead.
2025-11-01 14:03:43 +00:00
Alex Rønne Petersen
4e943fc847
std.c: add missing MINSIGSTKSZ for some FreeBSD targets 2025-11-01 09:58:05 +01:00
Frank Denis
d5585bc650
Implement threaded BLAKE3 (#25587)
Allows BLAKE3 to be computed using multiple threads.
2025-11-01 07:40:03 +01:00
Jay Petacat
5a38dd28dc std: Skip element comparisons if mem.order args point to same memory
This optimization is used in `mem.eql`, but was missing from `order`,
`orderZ`, and `ascii.orderIgnoreCase`.
2025-10-31 18:34:33 -07:00
Alex Rønne Petersen
8468549726
std.Target: bump vulkan max version to 1.4.331 2025-10-31 15:46:44 +01:00
Alex Rønne Petersen
d677086bcd
std.Target: bump opencl/nvcl max version to 3.0.19 2025-10-31 15:46:29 +01:00
Alex Rønne Petersen
adbf46aef3
std.Target: bump cuda max version to 13.0.2 2025-10-31 15:46:08 +01:00
Alex Rønne Petersen
802ee515d8
std.Target: bump amdhsa max version to 7.1.0 2025-10-31 15:45:57 +01:00
Alex Rønne Petersen
27c949689e
std.Target: bump wasi max version to 0.3.0 2025-10-31 15:45:43 +01:00
Alex Rønne Petersen
3801e6366f
std.Target: bump dragonfly max version to 6.4.2 2025-10-31 15:45:26 +01:00
Alex Rønne Petersen
a9c648c060
std.Target: bump linux max version to 6.17 2025-10-31 15:45:13 +01:00
Alex Rønne Petersen
0116d98093
std.Target: bump fuchsia max version to 28.0.0 2025-10-31 15:45:01 +01:00
Alex Rønne Petersen
38413446b0
std.Target: bump contiki max version to 5.1.0 2025-10-31 15:44:47 +01:00
Alex Rønne Petersen
a46c3a1582
test: remove some unsupported x86_64 darwin targets from llvm_targets 2025-10-31 15:36:17 +01:00
qilme
8347791ce3
std.os.windows: eliminate forwarder function in kernel32 (#25766)
#1840

kernel32.AddVectoredExceptionHandler -> ntdll.RtlAddVectoredExceptionHandler
kernel32.RemoveVectoredExceptionHandler -> ntdll.RtlRemoveVectoredExceptionHandler
kernel32.ExitProcess -> ntdll.RtlExitUserProcess
kernel32.InitializeCriticalSection -> ntdll.RtlInitializeCriticalSection
kernel32.EnterCriticalSection -> ntdll.RtlEnterCriticalSection
kernel32.LeaveCriticalSection -> ntdll.RtlLeaveCriticalSection
kernel32.DeleteCriticalSection -> ntdll.RtlDeleteCriticalSection
kernel32.TryAcquireSRWLockExclusive -> ntdll.RtlTryAcquireSRWLockExclusive
kernel32.AcquireSRWLockExclusive -> ntdll.RtlAcquireSRWLockExclusive
kernel32.ReleaseSRWLockExclusive -> ntdll.RtlReleaseSRWLockExclusive
kernel32.WakeConditionVariable -> ntdll.RtlWakeConditionVariable
kernel32.WakeAllConditionVariable -> ntdll.RtlWakeAllConditionVariable
kernel32.HeapReAlloc -> ntdll.RtlReAllocateHeap
kernel32.HeapAlloc -> ntdll.RtlAllocateHeap
2025-10-31 13:54:50 +00:00
TibboddiT
62de7a2efd
fix typo in std.debug.ElfFile.loadSeparateDebugFile
closes #25667
2025-10-31 09:44:47 +01:00
Alex Rønne Petersen
389368392e
Revert "ci: stop building FreeBSD module tests on x86_64-linux"
This reverts commit 16c18b835e16bae7a0f85caa29457f4ae4b7b417.

There must be one CI script that doesn't skip anything.
2025-10-30 23:17:33 +01:00