Time |
Nick |
Message |
00:01 |
MTDiscord |
<luatic> alright, just reran my benchmarks, PCGRandom still beats PseudoRandom on my machine. |
00:01 |
BluebirdGrey51 |
You know what? I just realized I could use the output of a PcgRandom to seed a PsuedoRandom. Unless I misunderstand the theory of random number generation |
00:01 |
MTDiscord |
<luatic> BluebirdGrey51: You can indeed do that :) |
00:02 |
MTDiscord |
<luatic> Basically at that point you're abusing the PcgRandom to turn a 64-bit seed into a 32-bit hash ;) |
00:03 |
MTDiscord |
<luatic> But I am a bit surprised that you're reporting that PseudoRandom is faster. What's your CPU? |
00:03 |
ireallyhateirc |
BluebirdGrey51, will that hack yield reproducible outputs though? |
00:04 |
BluebirdGrey51 |
Hold on a sec, I'm slow |
00:04 |
BluebirdGrey51 |
CPU: 24 of i7-13700K |
00:05 |
BluebirdGrey51 |
tho the 24 prob doesn't make a diff |
00:06 |
BluebirdGrey51 |
ireallyhateirc, as I think about it, I can't see any reason why It wouldn't be reproduceable? |
00:06 |
MTDiscord |
<luatic> the number you get out of a pseudorandom after seeding it is perfectly deterministic |
00:06 |
ireallyhateirc |
well then do whatever works, it's all hacks at this point anyway |
00:06 |
MTDiscord |
<luatic> pcgrandom* |
00:06 |
MTDiscord |
<luatic> (holds for both) |
00:07 |
MTDiscord |
<luatic> well imma get back to studying |
00:08 |
BluebirdGrey51 |
luatic: I assume that benchmark is supposed to be put in an init.lua and run at server load time? |
00:09 |
MTDiscord |
<luatic> BluebirdGrey51: yes |
00:09 |
BluebirdGrey51 |
Here's my results: Lua 0.00171645 µs/call |
00:09 |
BluebirdGrey51 |
PCG 0.02058436 µs/call |
00:09 |
BluebirdGrey51 |
K&R 0.02023658 µs/call |
00:09 |
BluebirdGrey51 |
Secure 0.02944957 µs/call |
00:10 |
MTDiscord |
<luatic> according to this PCG and K&R would very much be on par on your machine |
00:10 |
MTDiscord |
<luatic> note that math.random seems to be an order of magnitude (> 10x) faster |
00:10 |
MTDiscord |
<luatic> (i observe the same on my machine) |
00:11 |
BluebirdGrey51 |
The specific case where I observed the noticeable slowdown was when trying to replace PsuedoRandom with PcgRandom in an 80*80*80 loop |
00:11 |
MTDiscord |
<luatic> it seems very possible that something else might've affected this |
00:12 |
BluebirdGrey51 |
Granted, not a real "benchmark" but it was a real-world use-case |
00:12 |
MTDiscord |
<luatic> seeing a diff would be helpful |
00:12 |
BluebirdGrey51 |
I flipped it back to PsuedoRandom and the slowdown vanished |
00:13 |
BluebirdGrey51 |
the code was also generating tables --- possibly that mattered |
00:13 |
BluebirdGrey51 |
I don't have a diff, my code for the mapgen I'm working on isn't published anywhere yet |
00:14 |
BluebirdGrey51 |
It was pretty basic though, terrain generation and grass placement, with some trees |
00:17 |
MTDiscord |
<luatic> well, i see two possible explanations here. one, there is a confounding factor that wasn't controlled for. two, what you're seeing is real, but not because pcgrandom is slower, but rather because your algorithm's runtime depends on random choices that are made and pcgrandom happens to make them in a way that makes your algorithm run slower. |
00:18 |
|
cation joined #minetest |
00:20 |
BluebirdGrey51 |
It would be very strange if an algorithm's performance would change depending on which PRNG is used ... very odd, I would have to think about it for awhile |
00:22 |
BluebirdGrey51 |
I'm so disorganized I don't even have my original code anymore, I got rid of the 80*80*80 PRNG loop just a few hours ago |
00:23 |
BluebirdGrey51 |
So actually, I COULD just switch to PcgRandom and it'd probably work just fine |
00:25 |
MTDiscord |
<luatic> well, some testing (in this case, rudimentary timing) is probably a good idea if you find it's running too slowly. though, then you should probably also start profiling. i can recommend https://content.minetest.net/packages/jwmhjwmh/jitprofiler/. |
00:25 |
MTDiscord |
<luatic> BluebirdGrey51: well, to give a very simple example, say you flip a coin and if it's tails you place a giant castle or something. say the old PRNG gave you heads, the new one gives you tails. note also that the distributions of the old and new PRNG will be different. |
00:26 |
MTDiscord |
<luatic> this is somewhat of a hypothetical, though. |
00:32 |
BluebirdGrey51 |
thanks for the profiler link! |
00:33 |
BluebirdGrey51 |
(does it have support for the mapgen env, tho, or is in main-thread only?) |
00:34 |
BluebirdGrey51 |
I guess I can easily find out |
00:45 |
BluebirdGrey51 |
main thread only. If I really need to I'd have to make it work in the mapgen env, but that's a different project. |
00:45 |
BluebirdGrey51 |
heading out now |
01:07 |
|
Kepler joined #minetest |
01:07 |
Kepler |
test |
01:07 |
Kepler |
cool, it works |
01:18 |
Kepler |
Well, I don't know why I came here tonight |
01:18 |
Kepler |
I got the feeling that something ain't right |
01:18 |
Kepler |
I'm so scared in case I fall off my chair |
01:18 |
Kepler |
And I'm wondering how I'll get down the stairs |
01:18 |
Kepler |
Clowns to the left of me, jokers to the right |
01:18 |
Kepler |
Here I am, stuck in the middle with you |
01:18 |
Kepler |
Yes, I'm stuck in the middle with you |
01:18 |
Kepler |
And I'm wondering what it is I should do |
01:18 |
Kepler |
It's so hard to keep this smile from my face |
01:19 |
Kepler |
Losing control, yeah, I'm all over the place |
01:19 |
Kepler |
Clowns to the left of me, jokers to the right |
01:19 |
Kepler |
Here I am, stuck in the middle with you |
01:19 |
Kepler |
Well, you started off with nothing |
01:19 |
Kepler |
And you're proud that you're a self-made man |
01:19 |
Kepler |
And your friends they all come crawlin' |
01:19 |
Kepler |
Slap you on the back and say, "Please, please" |
01:19 |
Kepler |
Trying to make some sense of it all |
01:19 |
|
Kepler was kicked by ShadowBot: Message flood detected. Use a pastebin like pastebin.mozilla.org. |
01:22 |
|
Beanzilla joined #minetest |
01:22 |
ireallyhateirc |
is this a poem? |
02:19 |
MTDiscord |
<warr1024> ireallyhateirc: https://www.youtube.com/watch?v=ln7Vn_WKkWU |
02:30 |
|
diceLibrarian2 joined #minetest |
02:33 |
|
OutlinedArc217 joined #minetest |
03:00 |
|
Road_Killer joined #minetest |
04:00 |
|
MTDiscord joined #minetest |
04:02 |
|
diceLibrarian2 joined #minetest |
04:06 |
|
liceDibrarian joined #minetest |
04:13 |
MTDiscord |
<jordan4ibanez> hello, fellow irc members, I am an irc member, like yourself, and I am here to say hello, so hi |
04:20 |
|
diceLibrarian2 joined #minetest |
04:28 |
|
fluxionary joined #minetest |
04:41 |
|
gregon joined #minetest |
04:58 |
|
gregon joined #minetest |
05:39 |
|
diceLibrarian2 joined #minetest |
05:41 |
|
liceDibrarian joined #minetest |
06:52 |
|
gregon joined #minetest |
07:20 |
|
Talkless joined #minetest |
07:23 |
|
Verticen joined #minetest |
07:26 |
|
Trifton joined #minetest |
07:27 |
|
fgaz_ joined #minetest |
07:35 |
|
x_ joined #minetest |
08:07 |
|
TomTom_ joined #minetest |
08:12 |
|
mrkubax10 joined #minetest |
08:20 |
|
mrkubax10 joined #minetest |
08:49 |
ROllerozxa |
*taps mic* is this thing on |
08:50 |
ROllerozxa |
hello jordan4ibanez: a fellow irc member. strangely enough your messages appear as coming from the MTDiscord user but I am sure it is nothing to worry about, you are an irc member as anyone else |
09:07 |
|
gregon joined #minetest |
09:15 |
|
jaca122 joined #minetest |
09:33 |
|
mrkubax10 joined #minetest |
09:49 |
|
vampirefrog joined #minetest |
10:08 |
|
gregon joined #minetest |
10:24 |
|
oneeyedalien joined #minetest |
10:32 |
|
gregon joined #minetest |
10:44 |
|
peterz joined #minetest |
10:49 |
|
peterz joined #minetest |
10:59 |
|
ireallyhateirc joined #minetest |
11:26 |
|
gregon joined #minetest |
11:41 |
|
peterz joined #minetest |
11:49 |
|
Dr_Dinnerbone joined #minetest |
11:49 |
|
Dr_Dinnerbone joined #minetest |
12:05 |
|
gregon joined #minetest |
12:20 |
|
mrkubax10 joined #minetest |
12:51 |
|
TomTom joined #minetest |
13:09 |
|
gregon joined #minetest |
13:12 |
|
Leopold joined #minetest |
14:16 |
|
gregon joined #minetest |
14:30 |
|
peterz joined #minetest |
14:37 |
|
peterz joined #minetest |
15:19 |
|
gregon joined #minetest |
15:34 |
|
ireallyhateirc joined #minetest |
15:44 |
|
Talkless joined #minetest |
15:47 |
|
mrkubax10 joined #minetest |
15:53 |
|
jaca122 joined #minetest |
16:08 |
|
gregon joined #minetest |
16:25 |
|
silverwolf73828 joined #minetest |
16:28 |
|
Verticen joined #minetest |
17:00 |
|
fluxionary joined #minetest |
17:42 |
|
Glaedr joined #minetest |
17:55 |
|
peterz joined #minetest |
18:03 |
|
peterz joined #minetest |
18:57 |
|
liceDibrarian joined #minetest |
20:42 |
|
ChanServ joined #minetest |
21:00 |
|
Hanicef joined #minetest |
21:11 |
|
Nusakan joined #minetest |
21:35 |
MTDiscord |
<mistere_123> typical irc conversation |
22:33 |
|
panwolfram joined #minetest |
23:05 |
|
Eragon joined #minetest |
23:52 |
|
loggingbot_ joined #minetest |
23:52 |
|
Topic for #minetest is now The official Minetest channel | Latest version: 5.8.0 (2023-12-04) | General, player and modding discussion is on-topic. If in doubt, post here | Responses may take a while, be patient | Rules: https://wiki.minetest.net/IRC#Rules | Development: #minetest-dev | Server list: https://minetest.net/servers | IRC logs: https://irc.minetest.net/minetest |