Branch: refs/heads/yves/caret_rng_hook
Home: https://github.com/Perl/perl5
Commit: 6bc71b6a0c329ca1e943f3a90994d17d0e1779be
https://github.com/Perl/perl5/commit/6bc71b6a0c329ca1e943f3a90994d17d0e1779be
Author: Yves Orton <[email protected]>
Date: 2026-10-04 (Sun, 04 Oct 2026)
Changed paths:
M dist/RNG/RNG.xs
M dist/RNG/t/pcg.t
Log Message:
-----------
fixup! dist/RNG: add random providers and distributions
Use only the bits representable by the configured NV mantissa when mapping a
U64 to a value below one. Scaling the full integer can round the largest
values to 1.0 on NV formats with fewer than 64 significand bits.
Fetch the PCG constructor seed before checking its type. This avoids a second
magic fetch for tied seeds. The regression test checks that FETCH runs once
and that the resulting rng sequence matches one initialized from an ordinary
seed.
Commit: a36f6a318d36c252e14ce8235f07aaec3abd68c7
https://github.com/Perl/perl5/commit/a36f6a318d36c252e14ce8235f07aaec3abd68c7
Author: Yves Orton <[email protected]>
Date: 2026-10-04 (Sun, 04 Oct 2026)
Changed paths:
M builtin.c
M embed.fnc
M pp.c
M t/op/rng/contract.t
Log Message:
-----------
fixup! rng: let rand use selected providers
Use PP stack operations in rand() and srand() so provider callbacks can grow
the Perl stack safely. Replace the argument with the result through RPP
helpers, and handle the reserved null slot used for calls without an
argument. This also removes the PP_wrapped overhead.
Fetch seed magic before inspecting or converting the seed. Check redaction
after the fetch, and use no-magic conversion afterward so tied seeds are not
fetched again. Refresh SP after a rand_bytes provider callback before storing
its result in the XSUB argument stack.
Allocate the default rand_bytes result after seeding and at its final size.
Keep the set_caret_X comment with its entry in embed.fnc.
Add tests for one-time tied-seed fetches, provider callbacks that grow the
stack in rand(), srand(), and builtin::rand_bytes(), and all-ones provider
output remaining below one.
Commit: c871b716f9bb1ca750d3a12bb4d7ee95a74f473b
https://github.com/Perl/perl5/commit/c871b716f9bb1ca750d3a12bb4d7ee95a74f473b
Author: Yves Orton <[email protected]>
Date: 2026-10-04 (Sun, 04 Oct 2026)
Changed paths:
M dist/RNG/RNG.xs
M dist/RNG/t/hmac_drbg.t
M dist/RNG/t/seed.t
Log Message:
-----------
fixup! dist/RNG: add random providers and distributions
Fetch get magic before checking optional RNG inputs or reading their flags.
ParseXS supplies NULL for omitted optional SV arguments, so guard each fetch
before calling SvGETMAGIC(). Check definedness after the fetch so tied values
can provide their value.
Use non-magic accessors after the explicit fetch to avoid running FETCH twice.
Add tied-scalar tests for each provider and for HMAC_DRBG entropy, reseed,
personalization, interval, and prediction-resistance inputs.
Commit: 683838f9b6156ff6f71b17cbc943013163211bb8
https://github.com/Perl/perl5/commit/683838f9b6156ff6f71b17cbc943013163211bb8
Author: Yves Orton <[email protected]>
Date: 2026-10-04 (Sun, 04 Oct 2026)
Changed paths:
M builtin.c
M dist/RNG/RNG.xs
M pp.c
Log Message:
-----------
fixup! rng: let rand use selected providers
Use the RC-aware stack ownership protocol when the RNG XS seed helper calls a
Perl method. Preserve the active stack mode, refresh SP after extending the
stack, and balance the temporary stack reference in RC mode.
The builtin rand_bytes XSUB uses the legacy XS wrapper. Mortalize its
allocated result so the wrapper can transfer it to the caller without leaking
it. Keep SP refreshed after the provider callback, which may grow the stack.
Compare: https://github.com/Perl/perl5/compare/fc08212cc581...683838f9b615
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications