lang: rename signed integer types sN -> iN

Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.

Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).

Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.

zig build test: 426/426; examples suite: 595/595.
This commit is contained in:
agra
2026-06-12 09:31:53 +03:00
parent 515ecebea7
commit d8076b9333
1054 changed files with 6836 additions and 6839 deletions

View File

@@ -3,7 +3,7 @@
//
// Content addressing is security-critical, so the digest is computed
// in-process: no shelling out, no platform crypto library. All 32-bit
// word arithmetic is done in s64 and masked back to 32 bits with
// word arithmetic is done in i64 and masked back to 32 bits with
// `& MASK32`, so the result is identical regardless of the host's
// native integer width or overflow behaviour.
//
@@ -39,7 +39,7 @@ MASK32 :: 0xFFFFFFFF;
// Round constants K[0..63] — the first 32 bits of the fractional parts
// of the cube roots of the first 64 primes (FIPS 180-4 §4.2.2).
K : [64]s64 = .[
K : [64]i64 = .[
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
@@ -51,31 +51,31 @@ K : [64]s64 = .[
];
// 32-bit right rotate. `word` must already be masked to 32 bits.
rotr :: (word: s64, n: s64) -> s64 {
rotr :: (word: i64, n: i64) -> i64 {
((word >> n) | (word << (32 - n))) & MASK32
}
big_sigma0 :: (x: s64) -> s64 { rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22) }
big_sigma1 :: (x: s64) -> s64 { rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25) }
small_sigma0 :: (x: s64) -> s64 { rotr(x, 7) ^ rotr(x, 18) ^ (x >> 3) }
small_sigma1 :: (x: s64) -> s64 { rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10) }
big_sigma0 :: (x: i64) -> i64 { rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22) }
big_sigma1 :: (x: i64) -> i64 { rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25) }
small_sigma0 :: (x: i64) -> i64 { rotr(x, 7) ^ rotr(x, 18) ^ (x >> 3) }
small_sigma1 :: (x: i64) -> i64 { rotr(x, 17) ^ rotr(x, 19) ^ (x >> 10) }
Sha256 :: struct {
h: [8]s64; // running hash state (each entry masked to 32 bits)
h: [8]i64; // running hash state (each entry masked to 32 bits)
buf: [64]u8; // partial-block buffer
buf_len: s64; // bytes currently in `buf` (0..63)
total_len: s64; // total bytes absorbed so far
buf_len: i64; // bytes currently in `buf` (0..63)
total_len: i64; // total bytes absorbed so far
// Crunch the 64-byte block currently in `buf` into the state.
process_block :: (self: *Sha256) {
w : [64]s64 = ---;
w : [64]i64 = ---;
t := 0;
while t < 16 {
base := t * 4;
w[t] = ((cast(s64) self.buf[base]) << 24)
| ((cast(s64) self.buf[base + 1]) << 16)
| ((cast(s64) self.buf[base + 2]) << 8)
| (cast(s64) self.buf[base + 3]);
w[t] = ((cast(i64) self.buf[base]) << 24)
| ((cast(i64) self.buf[base + 1]) << 16)
| ((cast(i64) self.buf[base + 2]) << 8)
| (cast(i64) self.buf[base + 3]);
t += 1;
}
t = 16;
@@ -186,7 +186,7 @@ Sha256 :: struct {
}
// Lowercase-hex ASCII byte for a 0..15 nibble. 48='0', 97='a'.
nibble_hex :: (n: s64) -> u8 {
nibble_hex :: (n: i64) -> u8 {
if n < 10 then xx (n + 48) else xx (n - 10 + 97)
}