Files
aji/tests/conformance/phase2/run/random_seeded.air
T
dev 7a74be3cf7 spec: bit-exact PRNG, canonical run record, global quiescence
Owner review of the RFC 0007 implementation:
- spec 11 §8.1: xoshiro256** with SplitMix64 seeding specified bit for
  bit, fill consumes ceil(n/8) outputs LSB first; golden vector; own
  implementation replaces std.Random (whose seeding differs)
- spec 07a: canonical run record; stdout/stderr as UTF-8 strings or
  base64 objects, files always base64 objects
- spec 11 §8: blocked only at global quiescence (no runnable unit, no
  known future event, unfinished execution)
- reserved feature resource_joins; test names are permanent and
  rule-descriptive (renamed resource_*/borrow_* tests)
- plan: remaining Phase 2 order heap/regions -> unsafe -> hosted ->
  reports -> aji.toml
2026-10-04 14:07:54 +03:00

25 lines
559 B
LLVM

; random.fill is deterministic for a given seed.
; expect: run
; grant: rng=random.read
; seed: 7
; result: [90,118,249,78]
; phase: 2
; spec: docs/reference/intrinsics.md
module test.random_seeded
air 0
lang 0.1
features [arrays, capabilities, effects, ownership, resources]
fn @main(%rng: cap<random.read>) -> array<u8, 4>
effects [random.read]
entry:
%b = local.alloc array<u8, 4>
local.zero %b
%m = borrow.mut %b
%s = slice.make %m
intrinsic random.fill(%rng, %s)
borrow.end %s
borrow.end %m
%r = local.load %b
ret %r