Repository navigation
BREAKING Changes
- [#8213]
base:runtime:Type_Infovariants are pointers, socase runtime.Type_Info_Struct:becomescase ^runtime.Type_Info_Struct:; the old form compiles with a deprecation warning - [#8532]
core:bytes: Allocating procedures gain an#optional_allocator_errorresult - [#8499]
core:compress: deflate's one-shot procedures are renamedcompress_*anddecompress_*, andmax_output_sizemoves intooptions - [#8179]
core:compress/lz4:expected_output_sizeis a hard limit when decompressing a frame - [#8694]
core:encoding/*:asn1,cbor,json,pemandxmlfollow their specs strictly;hex,hxa,iniandpemreport errors where they returnedokor nothing;base32matchesbase64's API, andbase64.decodedropsdst;csvdropsmultiline_fields; a failedcborunmarshal leaves its allocations for the caller to free; v1 UUIDs made before read back a different time, also [#8418] [#8428] [#8429] [#8433] [#8471] [#8472] [#8500] [#8531] [#8636] [#8681] [#8683] [#8690] [#8692] - [#8201]
core:image/jpeg: CMYK and YCCK images are returned as CMYK instead of RGB - [#8394]
core:math,core:math/*:bigrenames and removes procedures, makes its tuning values#configconstants, changesatoiand expects canonicalRats;linalg'snormalizeguards against zero and vectorrefracttakes a scalareta;hlsl'sas*reinterpret bits;gcd,lcmandbiasare stricter about types;float32_paretodropsbeta, also [#8139] [#8283] [#8286] [#8322] [#8350] [#8376] [#8390] - [#8207]
core:mem/virtual:total_usedandcurr_block.usedaren't kept current; usearena_total_used - [#8560]
core:os:EISDIRis the newGeneral_Error.Is_Dir - [#8546]
core:rexcode/ir/wasm:Memarg.alignis a log2 exponent, and memory instructions take a memory index - [#8687]
core:slice,core:sort: Sorting is stable, comparators must be strict weak orders, and thesort_byprocedures are groups that can't be taken as values, also [#8618] - [#8530]
core:strconv: Unquoting returns errors, and writers report short buffers - [#8543]
core:sys/wasm/wasi:iovec_tandciovec_tare WASI's{buf, buf_len}structs, andsize_tisu32 - [#8319]
core:text/edit:Command_Setisu64, andCommandandTranslationare renumbered - [#8094]
vendor:directx/d3d11: Some names lose theirID3D/ID3D11prefix - [#8442]
vendor:kb_text_shape:glyphdrops itsDecompositionfield - [#8667]
vendor:x11/xlib: Signatures, return types and mask widths match the X11 headers, also [#8658] - [#8624]
#soa: Columns of#soaslices and dynamic arrays are slices instead of multi-pointers, andType_Info_Struct.usingsis replaced byfield_flags - [#8539] Unused
allocatorparameters are removed incore:encoding/xml,core:image,core:io,core:math/bigandcore:math/ease - [#8260] Values cut down to fit a
usingsubtype are a compile error - [#8421]
-define:NAME=VALUEis parsed by its#configdefault's type, and quotes are no longer stripped - [#8464]
asm: Pushing, calling or writing the stack pointer requires#align_stack
New Language Features
- [#8305] Defaults of polymorphic procedure parameters are checked in the callee's scope, so they can use
Tor the callee's private names, e.g.x := T(3),y: T = HIDDENandp := proc(x: T) {...} - [#8302] Allow
T(x)and(T)(x)with a polymorphicT, ascast(T)xalready was - [#8237]
bit_fieldtags are part of the type, likestructtags - [#8479]
proc "vectorcall"for i386 and amd64 - [#8464]
asmtemplates can make calls: through procedure-typed parameters, to procedures by name (call foo,call pkg.foo), and through registers, memory and internal labels- Calls to outside code clobber every register, and register operands are pinned automatically
- A call returns unless the callee is
-> !; callees using the Odin calling convention are rejected
- [#8563]
simd_shufflecan take more indices than its operands have lanes, so a 128-bit vector widens to 512 bits in one step, e.g._mm512_broadcast_i32x4 - [#8569]
asm: Shifts, rotates,shldandshrdby%cl, e.g.shr r, %cl - [#8624]
#soaadditions#soa_spliton a struct field stores the field's own fields, or the lanes of an array of up to 4 elements, as#soacolumns of their own#soa[dynamic; N]T, the#soaform of fixed capacity dynamic arrayscopybetween#soaslices and slices;#soa[]compound literals;#soa[N]Tto[N]Tconversions and back;==on#soa[N]T;shrinkon#soa[dynamic]T#soa[$N]Tparameters inferN, an#soaconstant can be indexed with a constant index, andintrinsics.type_soa_field_sizes(T)gives the column sizes
- [#8618] Procedure groups can overload on a constant parameter: a constant argument picks the
$form, anything else the plain one - [#8650]
intrinsics.simd_lanes_shift_leftandsimd_lanes_shift_rightshift lanes and fill with zeros;core:simdhas them aslanes_shift_leftandlanes_shift_right, plusscan_add, an in-register prefix sum - [#8654]
#no_aliason[]T,string,[dynamic]T,#soa[]Tand#soa[dynamic]Tparameters promises their data doesn't overlap, like C'srestrict; range loops over them skip the overlap check
New Compiler Improvements
Speedups
- [#7937] Copy large values of a multiple assignment through memory
a^, b^ = b^, a^andx, ok = make_big()on large structs or arrays no longer hand LLVM thousands of first-class aggregate elements- A procedure that took 8 minutes at
-o:speed(and ran out of memory at-o:minimal) builds in about a second
- [#8413] Skip or share copies of large values in multiple assignments
- A procedure with eight swaps of 4 KiB values now has a 1 KiB frame instead of 16 KiB at
-o:noneand 8 KiB at-o:speed - Such swaps run 10-33% faster at
-o:none
- A procedure with eight swaps of 4 KiB values now has a 1 KiB frame instead of 16 KiB at
- [#8213] Type info records are emitted at their own size (48-120 B instead of 112 B), and
__type_info_ofuses a multiply instead of% - [#8237] Shrink type info member data
- Each type info member buffer is sized for exactly the kinds that use it
structs andbit_fields with no tags orusingfields share one zero block, and enums whose values are exactly0..<nshare one array- Type info: demo -10.7%,
tests/core-12.4%
- [#8284] Store the constant fields of big, sparse struct literals directly, instead of copying the whole literal from read-only data
- Applies to literals over 64 bytes whose non-zero constant bytes are under a third of the literal, with at most 16 non-zero leaves
- OLS's executable is about 17 KB smaller at
-o:speed, and 37 KB at-o:none
- [#8508]
-internal-by-valueonly copies arguments that could be written during the call- The flag's run-time cost drops from +2% to +1β1.6% at
-o:speed, and from +8β10% to +1β1.5% at-o:none - [#8510] Boxing a value into an
anyfor a call no longer counts as an escape, so printing or logging it doesn't force copies
- The flag's run-time cost drops from +2% to +1β1.6% at
- [#8624] Faster
#soaarrays and range loops- Columns are staggered, so power-of-two lengths no longer make them evict each other from the L1 cache: summing an 18-column
#soa[1<<14]is 4x faster - At
-o:sizeand up, a range loop over a[dynamic]Tor resizable#soaarray whose body can't change the array reads its header once: 4.4-5.9x faster appendto an 18-column#soa[dynamic]12x faster; 50,000append_nothingon an#soa[dynamic]take 0.83 ms instead of 330 mscopybetween slices and#soaslices moves transposed blocks, 1.4-2.3x faster- [#8633] Arithmetic on
#soaelements that are arrays of numbers vectorizes across elements: 2.7-3.6x - [#8655] Loops whose bodies write through slices and pointers read the header once too, guarded against wraparound
- Columns are staggered, so power-of-two lengths no longer make them evict each other from the L1 cache: summing an 18-column
- [#8648] amd64 code is tuned for
genericwhen no-microarchis given, as clang does - [#8589] Escape analysis:
odin checkof a 340,000-line program takes 2.0 s instead of 29.4 s, and peak memory on a program with 4,000 pointer globals drops from 968 MiB to 752 MiB, also [#8574] - [#8611] Fix exponential time from
gb_maxevaluating recursive calls twice
High Impact
General fixes and improvements
- [#8184] Fixes #3973: Compiler crash on an array of values of different types that have
using - [fb711d3] Fix matrix SIMD stores, row-major strides and transpose
- [#8202]
odin bundle android: Read Android SDK versions fromsource.properties - [#8217] Fixes #8216:
-build-mode:dynamiclink failure with an@in a constantstringparameter - [#8219] Print the Windows error message if
odin runfails to launch the program - [#8293]
odin test: Error on a package with no tests, after reporting any other errors, and on@(test)procedures not declared at file scope, also [#8220] [#8290] [#8291] - [#8224] Look for MSVC and the Windows SDK in
bin\msvc, for self-contained installs - [#8237]
bit_fields that differ only in tags no longer share atypeidand type info record - [#8249] Fixes #7991: macOS warning about ignoring duplicate libraries
- [#8260] Reject values cut down to a
usingsubtype (#3973) - [#8622] Polymorphism: Fixes #4578, #7120, #7699, #7927, #8097, #8188, #8194 and #8294, also [#8261] [#8296] [#8297] [#8301] [#8302] [#8303] [#8305] [#8568]
- Unspecialized polymorphic types are rejected in record members, local variables, parameter defaults and type switch cases; sizing such a record deadlocked
odin check - Records instantiated with a
typeidargument are concrete, and ones instantiated with unknown constants are polymorphic - Converting to a polymorphic type works as
castdoes, and parameter defaults are checked in the callee's scope - Variadic polymorphic procedures infer their element type from separate arguments; procedure groups accept type and value parameters of the same type
- Unspecialized polymorphic types are rejected in record members, local variables, parameter defaults and type switch cases; sizing such a record deadlocked
- [#8282] Merge the target machine's features into per-procedure
target-features, so@(enable_target_feature)no longer drops them (SIGILLon NetBSD) - [#8299] Fixes #8102: Don't add aliases of
@(export)procedures as dependency roots - [#8300] Fixes #7502: Fix sizing a struct whose fields are still being checked; check local declarations in source order
- [#8320] Fix compiler crash on
absofcomplex32andquaternion64 - [#8335] Round integer constants to
f64once (1e25and others came out 1 ulp low) - [#8377] Lower
fixed_point_mul,fixed_point_divand their_satforms as plain integer arithmetic- Fixes the 128-bit
divbuild crash, wrong_satresults onwindows_i386, and LLVM's undefined overflow and unspecified rounding - Scale 0 is now allowed
- Fixes the 128-bit
- [#8396] Fix an assertion failure in Objective-C selector calls whose arguments are all named
- [#8412] Read multiple-assignment values before any store when a target is blank, e.g.
a, _ = b, f(&b) - [#8421] Parse
-definevalues by their#configdefault's type- A string
#configtakes the text verbatim, so-define:VERSION=1.0and-define:MODE=truework against one - A number is read as an Odin number literal and assigned as in source; an enum takes one of its field names
-define:NAME=is now allowed
- A string
- [#8613] Escape analysis: Fewer false warnings, and clearer ones, also [#8478] [#8497] [#8591] [61849d0] [97ef4ed] [c12f833] [030502c] [ece728c]
- A store clears what earlier stores put in the memory it writes, including through calls such as
reset(&thing), and a store cleared on one path is dropped where the paths join - Warnings say where stack memory escapes, through which call, and what that procedure does with it
- Calls nested in plain expressions and the deferred procedures of calls at scope end are followed; a loop rebuilding a union's variant no longer makes
odin checkuse gigabytes a second
- A store clears what earlier stores put in the memory it writes, including through calls such as
- [#8457] Fixes #8455: Reject directories in
#loadand#load_hash(#loadof a directory crashed the compiler on ext4) - [#8569]
asm: Loadsa fixes, also [#8464] [#8570]- Writing an input (directly, through a width-view, or by writeback) miscompiled at
-o:speed; registers written by name are always clobbered, and the stack pointer never implicitly - ARM64
#pre/#postno longer lose their writeback, nor ARM64 and RISC-V their$displacements; base-less memory operands work on both, and RISC-V offsets must be-2048..=2047 in/outrecord their implicit DX/AL; accumulator short forms such asadd 5, which LLVM rejected, are refused with a hint; the checker loses several false positives and three crashes
- Writing an input (directly, through a width-view, or by writeback) miscompiled at
- [#8465] Convert untyped default values of inferred parameter types, so
n := Xwith anXthat doesn't fit errors liken: int = X(it crashed the backend) - [9d7ed7c] Print the backing type in
bit_setexpression strings - [#8470] Fixes #8468: Build and test Odin on OpenBSD 8.0
build_odin.shskips anllvm-configthat lacks any of Odin's targets- The compiler no longer leaks a directory handle per package directory it reads
- [#8547] ABI: Match MSVC and clang, also [#8479] [#8481] [#8535] [c7db777] [a7669ed]
- Windows x86:
vectorcall; Win32 and i386fastcallmatch MSVC, with decorated symbols; Win64 passes 8-byte vectors in a general register and vectors over 16 bytes by pointer - SysV amd64: argument registers are counted correctly, 32- and 64-byte vectors go in YMM/ZMM with AVX or AVX-512, and
#simd[N]rawptrno longer crashes the compiler - x86 lowers wide vectors by the build's target features, so
@(enable_target_feature)procedures agree with their callers; wasm32 passes C vector arguments as clang does - i386 returns floats in integer registers, so signalling NaNs keep their payload; arm64 and riscv64 pass 16-byte, 16-aligned aggregates as
i128;simd_odd_eveninterleaves lanes as documented
- Windows x86:
- [#8507]
@(deferred_in)and@(deferred_in_out)pass the deferred procedure the argument values from the call, however they were passed - [#8520] Name the program in
odin run's launch errors, and fix the use ofposix_spawn - [#8528] Keep the
typeidof parapoly and#typeoperands in constant compound literals;[1]typeid{Box(int)}stored a niltypeid - [#8601] wasm: Fixes #8177, also [#8541] [#8543]
wasi_wasm64p32programs run:ODIN_ARCHreports.wasm64p32,-microarch:mvpbuilds validate, and global slice literals and#loadas[]byteor[]u16no longer asserti128andu128are 16-byte aligned with LLVM 20 and later, as LLVM lays them out, and a constant union passed by value no longer crashes the compiler
- [#8540] Fixes #7199: An error on a long source line no longer takes memory quadratic in its length (9 GiB for a 40,000-character line); messages shorten long string literals
- [#8550] Fixes #1909 + #8536:
type_ofandintrinsics.atomic_type_is_lock_freeof a built-in procedure report an error instead of crashing the backend - [#8556] Fixes #8554 + #8555:
-microarch:nativeand-target-features- On Apple arm64,
nativelackedneon, soHAS_HARDWARE_SIMDread false and SIMD code fell back to scalar paths -target-featuresnames match case-insensitively; empty items are skipped, and a bare+or-is reported-target-features:?marks the features implied bynative
- On Apple arm64,
- [#8558] An enum over a
distinctinteger type takes its signedness from that type; it was read from the wrong field, so comparisons could be signed or unsigned from one build to the next - [#8563] Fixes #8513: Let
simd_shuffletake more indices than its operands have lanes - [#8571] Never re-read volatile, atomic or non-temporal loads
- Selecting a field or index of
volatile_load(p)ornon_temporal_load(p)re-read it throughpwith a plain load - Boxing such a load, or an
atomic_load, intoanyhanded outpitself - Non-temporal aggregate stores stay whole at
-o:none
- Selecting a field or index of
- [#8573] Swizzle
op=acts likex.s = x.s op y; fixes#soaelement swizzles, andswizzlewith more than four indices - [#8576] Same-named
@(private="file")generics in different files no longer share instantiations, which ran the other file's body, failed to link or crashed the compiler - [#8579] Fixes #2162, #2741, #3315, #4305, #4321, #4728, #4958, #5071, #5386, #5832, #6376, #6754, #7935, #7990, #8295, #8490: Overhaul how the compiler resolves, stores and passes on paths
- Packages build from
..; a filesystem root, or-outinto a missing directory, is an early error instead of a linker failure - A directory is one package, whatever its case on Windows or the symlink it was reached through
- Paths longer than 260 characters work on Windows;
ODIN_ROOTis kept byte for byte, and must be a directory - Shared libraries are passed as
-L<dir> -l:<name>on every host; escaped quotes in-extra-linker-flagsare kept on Windows; resource files reach the linker with-ltoand-linker:lld - Debug info names each file by its full path, so a
main.odinin another package no longer folds into the main package's #load,#existsand#load_hashreject paths with an embedded NUL; directory walks no longer follow symlinks out of their tree or loop- The build cache is keyed on file contents and the full argument list
- New
-path-prefix-map:<old>=<new>for#file,#directory,ODIN_ROOTand debug info;-export-dependencieslists#loadfiles - A linker killed by a signal is reported
- Supersedes #8549
- Packages build from
- [#8584]
-sanitize:addressno longer unpoisons everybase:runtimelocal on return; only instrumented procedures unpoison their locals - [#8586] Opt-in
-sandbox-root:<dir>confinesimport,foreign importand#load*paths- The main package and every plain or absolute path must lie inside a sandbox root; a collection such as
core:may lie outside, but no path may leave it - A
system:library must be a bare name - The check and the read use the same directory handles, so a symlink swapped in between can't redirect the read
- Without it, nothing changes
- The main package and every plain or absolute path must lie inside a sandbox root; a collection such as
- [#8590] Fixes #8588: Build the compiler on riscv64 Linux
- [#8604]
intrinsics.read_cycle_counterreads the monotonic clock on wasi, js and Orca, where it was 0, so the test runner andcore:math/randno longer draw the same sequence every run - [#8615] Stop with a plain error when code or polymorphic instantiations nest more than 100 levels deep, also [#8612]
- [#8624] Indexing an
#soacolumn through a pointer is bounds checked; the error for[N]T(x)suggests([N]T)(x) - [#8637] Fixes #6076: Intermediate object paths no longer get a doubled separator when
TMPDIRends in one, as it does on macOS - [#8640]
#load_directorywarns when a directory holds only subdirectories, which it doesn't load, instead of silently returning an empty slice - [#8618] i386: Large Odin-convention aggregates go by reference, as on the other targets, and a zero-size argument no longer misplaces a split multiple-value result
- [#8657] A variable holding a procedure, passed to a group with a constant procedure parameter, no longer crashes the backend
- [#8687] Zero-sized globals are padded to one byte on Windows, where radlink failed on a relocation against an empty section
- [#8693]
odin runon Linux lets the program handle the firstSIGINT, so it can exit cleanly and the compiler still cleans up
New Packages
- [#8630]
core:archive: One API over zip, tar and 7z, which register when imported- Detects the format from the content, and lists, finds and extracts members;
extract_allchecks paths and enforces size and ratio limits - Crash-safe updates: whole-file locks, a journal for in-place appends, and rewrites through a temp file
- [#8634]
extract_to_dynamicandextract_current_to_dynamicunpack a member into a[dynamic]u8 - [#8695]
findreturns onlyFile_Infoand an error; a missing path isGeneral_Error.Not_Found mini, incore:archive/example, packs, lists, tests and unpacks all three formats
- Detects the format from the content, and lists, finds and extracts members;
- [#8631]
core:archive/sevenz: Read, write and update 7z archives- Copy, LZMA, LZMA2, PPMd, Deflate, Deflate64 and bzip2; the Delta, BCJ, BCJ2, Swap2 and Swap4 filters; solid blocks, compressed and encrypted headers, 7-Zip AES-256, and self-extracting archives
- Updates append in place, or rewrite only the solid blocks that lose members
- [#8632]
core:archive/tar: Read and write tar archives, also on streams that can't seek- v7, ustar, GNU, star and pax headers, long names, and sparse files when reading
- gzip, bzip2, LZ4, LZMA and XZ compression, detected from the content
- Writes pax, ustar or GNU, compressed or not
- [#8679] Reads and writes
.tar.lz
- [#8630]
core:archive/zip: Read, write and update zip archives- Reads Store, Shrink, Reduce, Implode, Deflate, Deflate64, bzip2, LZMA, PPMd and XZ; ZipCrypto and WinZip AES; ZIP64, data descriptors and self-extracting archives
- Writes Store, Deflate, Deflate64, bzip2, LZMA, PPMd and XZ, with WinZip AES-256, and reproducible archives on request
- Updates append in place, or rewrite the archive to replace, remove or rename members
- [#8205]
core:compress/bzip2- Compressed output is byte-identical to
libbzip2 - Decompression reads from a stream incrementally and handles concatenated streams
- Compressed output is byte-identical to
- [#8252]
core:compress/filters- BCJ for x86, PowerPC, IA-64, ARM, ARM Thumb, SPARC, ARM64 and RISC-V, plus Delta, Swap2/Swap4 and 7z's BCJ2
- [#8242]
core:compress/lzma- Decoder and encoder for
.lzmafiles, raw LZMA (7z, zip method 14) and raw LZMA2 (xz, 7z) - A port of the public domain LZMA SDK 26.05; the encoder's output is byte-identical to the SDK's
- [#8243] Fix 32-bit LZMA bug
- [#8244] A small bit of LZMA hardening
- [#8245] Check the range coder before the prob table, add
LZMA_NORMALIZE_AT - [#8679] Reads and writes lzip (
.lz) files, multimember ones included, following lzip 1.26's checks
- Decoder and encoder for
- [#8230]
core:compress/pkzip-legacy- Decompressors for the legacy ZIP methods: Shrink, Reduce and Implode
- [#8247]
core:compress/ppmd- Decoder and encoder for PPMd var.H (7z) and var.I rev.1 (zip method 98); output is byte-identical to 7-Zip 26.02's
- [#8499]
core:compress/xz- Reads and writes
.xzin one call or streaming, and decodes single blocks through a file's index
- Reads and writes
- [#8659]
core:crypto/cert_store: Trust stores for TLS- A nil store uses the operating system's: CryptoAPI on Windows, the Security framework on macOS, and the system roots elsewhere, where
SSL_CERT_FILEandSSL_CERT_DIRoverride where they come from - A
Storetrusts only the roots given toappend_derandappend_pem, such as a development CA
- A nil store uses the operating system's: CryptoAPI on Windows, the Security framework on macOS, and the system roots elsewhere, where
- [#8397]
core:crypto/tls: Initial import of a blocking TLS 1.3 client- Requires an external certificate store
- TLS 1.3 only
- Not supported yet: ECH, client certificate authentication, GREASE, and PSK/0-RTT/early data
- [#8659] Verifies servers against
core:crypto/cert_store;tls.closejoins its worker threads, andcore/crypto/tls/exampleis a minimal HTTPS GET - [#8684] Ignores post-handshake
NewSessionTicketrecords
- [#8666]
vendor:x11/xrender: Bindings for the X Rendering Extension, alongsidevendor:x11/xlib
Package Improvements
Speedups
- [#8623]
base:runtime:cstring_lenup to 20x andcstring_cmpup to 13x faster on long strings,cstring16_lenandcstring16_eq6.7-7.7x;memory_equaluses overlapping loads for short lengths, andmemory_compareand string comparison work in big-endian chunks, also [#8572] [#8614] - [#8499]
core:compress: Inflate, LZMA decode, LZ4 HC, Delta and pkzip-legacy are faster;core:hash:adler32gets AVX2 and NEON kernels - [#8208]
core:compress/deflate: Further speedups to (de)compression, up to +79% compression and +16% decompression - [#8144]
core:crypto: Add ARM GHASH hardware acceleration (AES-GCM about 9x faster on an M4 Pro) - [#8565]
core:crypto/legacy/sha1: Hardware SHA-1 on amd64 and ARMv8; the portable path is 1.6-1.8x faster - [#8486]
core:hash: Foldcrc64_xzwith carry-less multiplies, up to 14.38x faster on the 5950X and 16.93x on the M4 - [#8324]
core:math/big:Ratadd/sub 16-18x and mul/div 11x,int_gcd10-11x, digit division 2.4-4x, and fasteratoianditoa, also [#8139] [#8322] - [#8207]
core:mem/virtual: Makevirtual.Arenaallocation lock-free; add.Single_Threadarena_alloc3.3x, and 7.2x with.Single_Thread- One shared arena on 4-16 threads: 3-6.6x
- [#8496]
core:os,core:strings: Skip zeroing the buffers ofread_entire_file,write_floatand friends, also [#8477] - [#8618]
core:slice: Hodgepodge sort replaces every sort: stable, in place, and without an allocator- About 10x faster than the old
sortoverall and 7x faster thanstable_sort; 25x for integers, 5-10x for small elements sort.sort(Interface)is 11-17x faster on sorted and reversed input, and 1.8x slower on random input- [#8687]
slice.cold_sort,cold_sort_byandcold_sort_by_cmpare stable and in place with a twentieth of the code;core's own sorts use them
- About 10x faster than the old
High Impact
- [#8499]
core:compress: Prep work forcore:archive/zip,tarand7z- Every codec but shoco gets a pull
Readerovercompress.Context, and every decoder a_to_writerform; bzip2, deflate, the filters, lz4, lzma and ppmd get aWriter - One-shots take
options: compress.Options, with output and memory limits and aprogresscallback that can cancel; a declared output size is exact compress.whichnames a stream's format from its first bytescore:image/pngreserves its output up front, andcore:image/jpegusescompress.input_size
- Every codec but shoco gets a pull
Runtime changes
- [#8643]
base:runtime: Fixes #8642, also [#8207] [#8213] [#8320] [#8325] [#8515] [#8543] [#8572] [#8584] [#8587] [#8603] [#8604] [#8606] [#8623] [#8624]- After an insert shifted map entries back, pointers from
map_entry,map_insertandmap_upsertcould point at the old slot, so writes through them were lost or landed on another key's entry map_alloc_dynamic's size check and fixed-capacityinject_atandassign_atno longer write out of bounds;arena_temp_endrolls back a temp begun before the arena had a blockType_Infovariants are subtypes with a pointervariant, and the#soaruntime works without RTTI- wasm: the allocator returns
Out_Of_Memoryinstead of asserting,i128>>andoverflow_mullink,_read_cycle_counterexists for wasi, js and Orca, and#soalengths onwasm64p32sit at the right offset - Complex
abshandles infinite and NaN parts;udivmod128uses onedivwhen it can;string16andcstring16compare by code unit value -bedrockbuilds work again,-no-crt -o:speedbuilds with amap[cstring]Tlink, and thecstringprocedures are@(no_sanitize_address)
- After an insert shifted map entries back, pointers from
General fixes and improvements
- [#8253]
core:*: Add copyright banners tocorepackages that had none - [#8539]
core:*: Pass allocators through, andfreeon the one that allocatedcore:math/big:int_sqr,rat_sqr,int_itoa_raw,internal_int_logand the combinatorics procedures take anallocator;incr,decrandfrom_bytesuse theirscore:crypto/tls,core:text/match,core:compress/shoco,core:image/bmpandcore:unicode/tools/ucdno longer put some buffers oncontext.allocatorcore:crypto/kmac:verifyfreed its scratch buffer on the wrong allocator, even with its defaults- Images remember their allocator, and
destroyfrees with it;bit_array,hxa,ucdand the js console logger destroy on their own allocator too - Error paths in
core:crypto/noise,core:encoding/json,core:text/i18nanducdfreed on the context allocator core:container/bit_array:createno longer returns a freed pointer when allocation fails
- [#8587]
core:*: Fix leaks and double frees- Use after free and double free:
parse_file_tags,ast.clone's shared lists, spirvdecode'sblk_params,slashpath.baseandnamewithnew = true - Out-of-bounds writes: fixed-capacity
inject_atandassign_at,map_alloc_dynamic's size check, Windows_read_link - Hangs:
core:nbio's Linuxrun()with only completed operations pending,bytes.split_multi_iteratorwith an empty separator - Leaks on error and allocation-failure paths in the odin, wasm and spirv parsers, the image loaders,
cbor,flags,net,nbio,regex,dynlib,bufio,os,strings,bytesandbase:runtime
- Use after free and double free:
- [#8532]
core:bytes,core:strings: Fixes #8365 and #8456, also [#8161] [#8483]scrubkeeps the text after the last invalid byte and leaves a valid U+FFFD alone;expand_tabscounts one column per rune; they and the justify procs copy invalid bytes unchangedbytes.centre_justify,left_justifyandright_justifypad tolength, and an empty pad no longer divides by zero;bytes.reverseuses itsallocatorbuffer_read_fromreturned zeroed bytes,buffer_write_atappended zero bytes when overwriting, andsplit_multinow matches each delimiter at its own length and rejects empty ones
- [#8470]
core:c/libc,core:os,core:sys/*: Fix the OpenBSD bindings for 8.0- Also fixes NetBSD's
libcstreams, aresolv.confcomment hiding the nameserver, andos.remove_allkeeps at most 32 directories open
- Also fixes NetBSD's
- [#8679]
core:compress,core:io: Bounded allocations, no silent truncation or hangs, and full docs, also [#8179] [#8206] [#8221] [#8229] [#8242] [#8501] [#8503]- An untrusted declared size can no longer make a decoder allocate far ahead of the data; tune with
-define:COMPRESS_INITIAL_RESERVATION=β¦and-define:COMPRESS_INITIAL_RESERVATION_RATIO=β¦; lz4 enforces output limits - Multi-member
lz4,bzip2and gzip input no longer ends early with success; a reader that keeps returning(0, nil)gives.No_Progressinstead of hangingcompress,ioorhash.hash_stream, and a zero-byte write gives.Short_Write - deflate adds Deflate64, verifies GZIP header CRCs, and never emits an empty distance code, which Windows' built-in ZIP folders reject
- Every public procedure, type and constant is documented, and the API-surface bugs that turned up are fixed;
compress.whichrecognises lzip
- An untrusted declared size can no longer make a decoder allocate far ahead of the data; tune with
- [#8306]
core:container/intrusive/list: Addinsert_*,move_*,replace,splice_*andsplit_* - [#8600]
core:crypto:hash.init,hash.clone,aead.init,hmac.init,kmacandtlswipe their contexts instead of reading them first, which is undefined behaviour; TLS handshakes could fail withFailed_Key_Share_Generation - [#8630]
core:crypto/aes: Addinit_ctr_le64, with a VAES CTR path;core:hash: Addcrc32_copy - [#8329]
core:crypto/chacha20: Allow the final block, refuse the blocks after it - [#8694]
core:encoding/*: Audit of every encoding package, fixing crashes, memory errors, overflows and spec gaps, also [#8115] [#8186] [#8283] [#8405] [#8407] [#8409] [#8410] [#8418] [#8428] [#8429] [#8433] [#8452] [#8471] [#8472] [#8500] [#8504] [#8531] [#8681] [#8683] [#8689] [#8690] [#8692] [859d7b1]json: strict.JSON, JSON5 per its spec, 128-bit integers that round-trip,.Disallow_*options,marshalofany,json:"-"skipped when unmarshalling, and unions that pick the variant that fitscbor: no double frees, and no crashes on row-major matrices, 128-bitbit_sets and nil destinations;to_jsonfollows RFC 8949; aMaybeholding 0 unmarshalsxmlandentity: well-formedness per XML 1.0, no hangs on<![or illegal CDATA characters, and no attributes lost past 8 to 64base32gainsbase64's procedures and Extended Hex;base32,base64andhexno longer overflow on 32-bit;asn1rejects impossible dates;hxasurvives crafted files;pemfixesLABEL_X509_CRL;varintreports.Value_Too_Largecsvreads doubled quotes in multiline fields;iniround-trips saved maps and addskeep_empty_sections; random v1 and v6uuidnodes set the multicast bit;core:strings' case conversions report allocation errors- Fixes #3474, #5681, #7443, #7764, #7765, #7767, #8061, #8103, #8185, #8378, #8417 and #8450
- [#8544]
core:flags: Opt-in colour for usage and error messages throughColor_Mode;.Autocolours only terminals and honoursNO_COLOR - [#7752]
core:fmt: Fixes #7698: Align complex and quaternion values to an explicit width, and keep the+between their parts for NaN and%h - [#8257]
core:hash/xxhash: Fix XXH3 streaming digests, which could differ from the one-shot hash - [#8203]
core:image/jpeg: Decode the rest of T.81, and save JPEGs, also [#8201]- Decodes 12-bit extended sequential and progressive DCT, lossless with all seven predictors at 2-16 bits, arithmetic coding, hierarchical mode,
DNLmarkers and 2-component images - Saves baseline, extended 12-bit, progressive and lossless JPEGs, with standard or optimised Huffman or arithmetic coding, in grey, YCbCr, RGB, CMYK and YCCK
- Decodes 12-bit extended sequential and progressive DCT, lossless with all seven predictors at 2-16 bits, arithmetic coding, hierarchical mode,
- [#8236]
core:image/png: Enforce chunk order and uniqueness;.ignore_duplicate_chunksskips duplicate ancillary chunks - [#8402]
core:math,core:math/*: Audit of every math package, fixing accuracy, special values, overflows and wrong results, also [#8283] [#8286] [#8314] [#8315] [#8316] [#8320] [#8330] [#8331] [#8332] [#8334] [#8336] [#8337] [#8338] [#8339] [#8340] [#8341] [#8342] [#8350] [#8354] [#8362] [#8375] [#8376] [#8377] [#8389] [#8390] [#8391] [#8394] [#8398] [#8400]math:remainder,wrap,sincos,cbrt,lgamma,erfc,tan,hypot,floor_divmod,remap,modf,pow10and more;sinandcosonwindows_i386no longer use the CRT's x87fsinbig: every file reviewed; reads never write, so threads can share inputs; Lucas-Selfridge no longer loops on perfect squareslinalg: quaternion length,nlerpand angle, adjugates, inverse transpose, polar,normalizeandvector_slerp; more spline procedures;glslandhlslfollow GLSL 4.60 and HLSLcmplxfollows C99 Annex G;bits,ease,fixed,noiseandrandfixdiv_u32, easing endpoints, fixed-point rounding, discontinuous 4D noise, and float ranges and distributions- Fixes #3321, #4503, #8238, #8266-#8271, #8273-#8275, #8278-#8280, #8289, #8292, #8307-#8311 and #8313
- [#8603]
core:mem,core:mem/virtual:Arenais backed by the heap on wasm, where everyArenafailed, and returnsOut_Of_Memoryinstead ofnilelsewhere without virtual memory; addarena_trim;Tracking_Allocator's docs point atcore:debug/trace, also [#8602] [eea8445] - [#8534]
core:net: Fixes #8200 and #8353, also [#8227] [#8233] [#8234] [#8355] [#8357] [#8358]- IP prefix, range and address utilities: CIDR parsing and formatting, containment, aggregation, summarisation, exclusion, subnetting, and classification against the IANA Special-Purpose Address Registries
- DNS responses are bounds-checked, SRV names live long enough, parses don't leak, spoofed replies are rejected, mDNS replies from the responder's own address are accepted, and host names may contain underscores
- Linux netlink interfaces no longer crash on tunnels or report the peer address or extra gateways;
SO_LINGERgets astruct linger
- [#8696]
core:os: Fixes #7547, #8091, #8092 and #8112, also [#8197] [#8259] [#8265] [#8281] [#8282] [#8356] [#8425] [#8560] [#8593] [#8597]- Windows: paths stay UTF-16, so names ending in a dot or space get their own entry;
statandlstathandle symlinks and junctions; empty arguments and ones with a tab are quoted; a pipe whose writer closed reads as.EOF - Processes:
process_execdrains its pipes to EOF and survives signals;process_killworks on a process opened on Windows; a nilenvinherits the environment;Process_State.signalnames the signal that ended it remove_allis an iterative walk that never follows links, and the walker closes its handles;read_atandwrite_atwork as documented;read_entire_filereads pipes to the end;os.nameworks on FreeBSD and NetBSD;General_Error.Is_Diris new
- Windows: paths stay UTF-16, so names ending in a dot or space get their own entry;
- [#8608]
core:path/filepath,core:odin: Build on wasi;os.get_absolute_pathworks there, lexically - [#8624]
core:reflect: Addsoa_field_countandsoa_field_value, and take#soavalues inlengthandcapacity;core:slice: Addretain;core:fmt: Print each#soaelement in place - [#8610]
core:rexcode/ir/wasm: Fixes #7586: Follow the Wasm 3.0 binary format, also [#8546]call_indirectandreturn_call_indirectcarry their table index; the typedselect,table.getandtable.setare new, tail calls decode, and table and memory limits areu64LEBsdecoderejects malformed modules and shared tables instead of misreading them, caps functions atMAX_FUNCTION_LOCALSlocals, ignores broken custom sections, and reads every relocation type correctlyprint_watno longer prints a finalendor drops thei64andsharedlimits, and spells floats and offsets as WAT does
- [#8538]
core:simd/x86: Clean up, and add the AVX-512F (over 555 intrinsics, plus the foreign imports for the rest), F16C, FMA, GFNI, SHA512, SM3, SM4 and VAES intrinsics, also [#8175] [#8485] [#8491] [#8495] [#8505] [#8522] - [#8463]
core:sort: Fixes #8458:compare_intsno longer overflows - [#8621]
core:strconv: Fixes #8363, #8368, #8369, #8370: Audit and fixes, also [#8530]- Long float inputs parse correctly, and
fmtandstrings.write_floatprint every digit of a large precision instead of zeros or a cut-off number unquote_stringchecks its quotes and no longer crashes on crafted input or an allocation failure; octal escapes no longer fail unless they end the stringquote_stringoutput always reads back as the same string;fmtno longer panics on an integer width over 253, and pads NaN and Inf with spaces, as in C- When no digits follow a sign or prefix, the integer parsers'
nfollowsstrtol; the prefix float parsers read0hand-0h;parse_complex128andparse_quaternion256reject invalid components
- Long float inputs parse correctly, and
- [#8660]
core:sys/*: Bindings and layout fixes, also [#6639] [#7745] [#8225] [#8226] [#8406] [#8422] [#8480] [#8526] [#8535] [#8639] [#8641]sys/windows:SetThreadExecutionState, dialog boxes,PurgeComm, pseudoconsoles,crypt32certificate chain building, and bindings from Karl2D and the Odin Installersys/linux: struct layouts match the kernel (Timexwas too short, and riscv64Sig_Actionhas norestorer),rt_sigaction(sig, nil, &old)no longer crashes,dup2is fully emulated on arm64 and riscv64, anduringaddsread_fixed,write_fixed,fallocateandunlinkatsys/posix:semid_dsis right on riscv64, anddlfcnlinkslibcon NetBSD and OpenBSD;sys/wasm/js:ReadnPixelspasses the typed array that matches the texture's type
- [#8453]
core:terminal: Add terminal size retrieval and control sequence helpers - [#8566]
core:testing: Fixes #7773 and #8246, also [#8248] [#8250] [#8251] [#8254] [#8256] [#8317] [#8476] [#8564]- Failed expectations count even when their log message is filtered out or
context.loggeris replaced; the summary gives the first error as the fail reason ODIN_TEST_INLINEruns each test on the main thread, the default where threads are unsupported;-build-mode:testsetsos.argson WASI, andcore:terminalgets awasibackend- Timeouts print more,
set_fail_timeoutcan be called more than once, and the JSON report has each test's duration and fail reason - The runner survives tests stopped while their threads still run, and C++ exceptions caught while a D3D12 or Vulkan device starts; the progress report no longer flashes, and
get_terminal_sizeno longer overwrites the stack
- Failed expectations count even when their log message is filtered out or
- [#8606]
core:text/edit,core:text/i18n:editadds multi-line editing, word classes, options and undo breaks, and the first edit afterinitcan always be undone;i18nfixes its byte order andDuplicate_Keyfor contextual plurals, also [#8262] [#8264] [#8319] - [#8285]
core:text/scanner: Add triple-quoted strings; Fixes #8288:cmplx.log10multiplied byLN10instead of dividing - [#8437]
core:thread: Fixes #8436: Zero the thread pool on destroy - [#8609]
core:time/timezone: Add a wasi backend: zones fromTZDIRor the usual zoneinfo directories,localfromTZ
Vendor packages
- [#8367]
vendor:compress/lz4: Update to v1.11.1, add the frame API and multithreading, also [#8192] - [#8582]
vendor:curl,vendor:zlib: Update zlib to 1.4, and curl's bundled nghttp2 to 1.71.0 andzstdto 1.6.0, for CVE-2026-124851; fix theurl_getsignature, also [#8212] [#8484] - [#8094]
vendor:directx/d3d11: AddIDeviceContext1, cleanup - [#8674]
vendor:kb_text_shape: Update to 2.33; shaping can be up to 12% faster, also [#8190] [#8210] [#8442] - [#8366]
vendor:libc-shim: Addcallocandfrexp, also [69e1207] - [#8298]
vendor:nanovg: UploadtexTypeandtypeas floats when there are no uniform buffers, which broke text and image rendering - [#8562]
vendor:OpenEXRCore: Update to 3.5.5, also [#8443] - [#8241]
vendor:OpenGL:ClearBufferfireturns nothing, as the specification says - [#8686]
vendor:sdl3: Update SDL to 3.4.20,imageto 3.4.10 andmixerto 3.2.6, also [#8191] [#8685] - [#8581]
vendor:stb: Update and fix ABI mismatches, also [#8366] [#8441] [#8561]stb_image2.34,stb_image_resize22.51,stb_image_write1.19,stb_rect_pack1.02,stb_truetype1.28 andstb_vorbis1.25, with their new procedures boundstbi_write_pngandstbi_write_png_to_functake ac.ptrdiff_tstride;fontinfogains its missingvheaandvmtx, so the fields afterhmtxare read at the right offsets; glyph indices and oversample factors arec.int, notb32
- [#8667]
vendor:x11/xlib: Fixes #8628: Fix the ABI breaks and link names found against the X11 headers and libX11, and addAllPlanesand the visual type constants, also [#8087] [#8629]
Miscellaneous
- [#8283]
build.batandbuild_odin.sh: Detect git worktrees, and run.\get-date - [#8415] FreeBSD and NetBSD are no longer tested on every CI run. Odin's support for them is unchanged.
- Both are still tested weekly, with the same tests
- Most failures seen only on these jobs weren't bugs in Odin: CDN outages, retired pkgsrc trees, and flaky timing on slow CI VMs
- [#8416] The Linux job checks
examples/allforfreebsd_amd64,freebsd_arm64,netbsd_amd64andnetbsd_arm64, as it already did foropenbsd_amd64
- [#8653] CI: A
build_pkg_docsjob builds pkg.odin-lang.org's docs, which had broken unnoticed;examples/allgains the packages it was missing
The test suites need less to run and fail less for the wrong reasons. misc/fixture-downloader replaces download_assets.py, so the tests no longer need Python, run_tests slim sets ODIN_TEST_SLIM for a quicker run, and run_tests sets JSON_MAX_DEPTH to 64, as ASan's larger frames overflow the stack at 128. tests/core compiles on NetBSD and OpenBSD, and now includes path/filepath, whose tests had broken unnoticed. The core:sync timeout is 10 seconds, the core:net and cert_store tests close their sockets once, the csrss.exe process test is skipped when it can't be opened, and the type info shim test no longer prints its expected warnings. [#8222] [#8228] [#8231] [#8255] [#8352] [#8359] [#8419] [#8527] [#8608] [#8626] [#8639] [#8663] [#8664]
CI runs more of them. The compress tests have their own suite, and the compression step runs the zip, 7z and tar tests; math/big also runs with two sets of lowered cutoffs, and the JSON differential harness runs with JSON_MAX_DEPTH at 64 for the Windows ASan job. riscv64 has its own suite, run with and without the V extension in 5 minutes instead of 23-28. Under wasmtime, the tests/core packages that pass on wasi_wasm32 run in a Linux job of their own, and the wasi_wasm64p32 demo runs too; the NetBSD job moved to NetBSD 11.0. [#8318] [#8394] [#8433] [#8499] [#8535] [#8543] [#8564] [#8567] [#8603] [#8604] [#8606] [#8608] [#8609] [#8630] [#8631] [#8632]
Janitorial work: stray, stale and obsolete comments are fixed or removed, among them in core:nbio, core:sync, core:math/ease's flux_update and the RISC-V crypto tests, and the core:image/png and bng package docs list them as readers and writers. [#8360] [#8408] [#8649] [#8688] [b34cfa3]
Many packages gained tests for procedures that had none: core:encoding/base32, endian, hex, pem, xml and entity, and core:math, math/big, math/bits, math/cmplx, math/ease, math/rand and math/noise, the last against upstream reference values; pem's tests now run in CI, and endian's package doc example is fixed. tests/vendor tests stb_truetype, SDL2_ttf and SDL3_ttf, and the test assets gain part of the Noto Sans family for them, new JPEG reference files and self-extracting 7z fixtures. [#8209] [#8214] [#8327] [#8351] [#8392] [#8393] [#8399] [#8403] [#8404] [#8420] [#8487] [#8488] [#8502] [#8533] [#8627] [90a9542]
Full Changelog: dev-2026-11...dev-2026-12