2018-02-26 15:52
cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs:
https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
00:10
DIRT has quit [Remote host closed the connection]
00:20
adamholmberg has quit [Ping timeout: 264 seconds]
00:46
adamholmberg has joined #pypy
01:06
jamesaxl has quit [Quit: WeeChat 2.1]
01:10
adamholmberg has quit [Ping timeout: 244 seconds]
01:36
adamholmberg has joined #pypy
01:39
dddddd has quit [Remote host closed the connection]
01:40
oberstet has quit [Ping timeout: 240 seconds]
01:59
asmeurer_ has joined #pypy
01:59
adamholmberg has quit [Ping timeout: 240 seconds]
02:12
altendky has joined #pypy
02:26
adamholmberg has joined #pypy
02:34
asmeurer_ has quit [Quit: asmeurer_]
02:34
asmeurer_ has joined #pypy
02:41
asmeurer_ has quit [Quit: asmeurer_]
02:55
adamholmberg has quit [Ping timeout: 244 seconds]
03:08
DIRT has joined #pypy
03:22
adamholmberg has joined #pypy
03:58
adamholmberg has quit [Ping timeout: 244 seconds]
04:14
DIRT has quit [Remote host closed the connection]
04:17
DIRT has joined #pypy
04:26
adamholmberg has joined #pypy
04:31
altendky has quit [Quit: Connection closed for inactivity]
04:59
adamholmberg has quit [Ping timeout: 264 seconds]
05:25
adamholmberg has joined #pypy
05:57
adamholmberg has quit [Ping timeout: 240 seconds]
06:24
adamholmberg has joined #pypy
06:56
adamholmberg has quit [Ping timeout: 244 seconds]
07:23
adamholmberg has joined #pypy
07:56
adamholmberg has quit [Ping timeout: 264 seconds]
08:23
adamholmberg has joined #pypy
08:32
_whitelogger has joined #pypy
08:52
adamholmberg has quit [Ping timeout: 260 seconds]
09:20
adamholmberg has joined #pypy
09:21
oberstet has joined #pypy
09:34
dddddd has joined #pypy
09:47
jamesaxl has joined #pypy
09:50
adamholmberg has quit [Ping timeout: 244 seconds]
10:01
adamholmberg has joined #pypy
10:02
DIRT has quit [Ping timeout: 264 seconds]
10:46
adamholmberg has quit [Remote host closed the connection]
10:47
adamholmberg has joined #pypy
10:52
adamholmberg has quit [Ping timeout: 256 seconds]
11:17
adamholmberg has joined #pypy
11:26
jcea has joined #pypy
11:26
jcea has quit [Client Quit]
11:29
jcea has joined #pypy
11:35
TheAdversary has quit [Read error: Connection reset by peer]
11:35
Hasimir has quit [Read error: Connection reset by peer]
11:39
TheAdversary has joined #pypy
11:41
Hasimir has joined #pypy
11:52
adamholmberg has quit [Ping timeout: 244 seconds]
11:56
antocuni has joined #pypy
12:19
adamholmberg has joined #pypy
12:28
jiffe has quit [Quit: WeeChat 2.1]
12:28
jiffe has joined #pypy
12:33
nunatak has joined #pypy
12:45
nunatak has quit [Quit: Leaving]
12:48
adamholmberg has quit [Ping timeout: 260 seconds]
13:15
adamholmberg has joined #pypy
13:17
realitix has joined #pypy
13:19
realitix has quit [Client Quit]
13:42
adamholmberg has quit [Ping timeout: 260 seconds]
14:03
asmeurer has joined #pypy
14:09
adamholmberg has joined #pypy
14:40
adamholmberg has quit [Ping timeout: 264 seconds]
15:02
antocuni has quit [Ping timeout: 240 seconds]
15:07
adamholmberg has joined #pypy
15:30
adamholmberg has quit [Ping timeout: 264 seconds]
15:49
antocuni has joined #pypy
15:57
adamholmberg has joined #pypy
16:00
DIRT has joined #pypy
16:07
antocuni has quit [Ping timeout: 260 seconds]
16:17
adamholmberg has quit [Ping timeout: 240 seconds]
16:22
asmeurer has quit [Quit: asmeurer]
16:25
asmeurer_ has joined #pypy
16:44
adamholmberg has joined #pypy
17:02
asmeurer_ has quit [Quit: asmeurer_]
17:04
jcea1 has joined #pypy
17:04
jcea has quit [Remote host closed the connection]
17:04
jcea1 is now known as jcea
17:07
adamholmberg has quit [Ping timeout: 264 seconds]
17:11
altendky has joined #pypy
17:21
asmeurer has joined #pypy
17:25
asmeurer has quit [Ping timeout: 260 seconds]
17:27
asmeurer has joined #pypy
17:31
asmeurer has quit [Ping timeout: 248 seconds]
17:34
adamholmberg has joined #pypy
17:55
<
cfbolz >
arigato: nice!
17:56
<
cfbolz >
I was going to ask whether it was you who wrote that, then I saw the window decorations :-)
17:56
<
arigato >
it's mostly fijal actually, but I "finished" it
17:57
<
cfbolz >
Just for the fun of it?
17:57
<
arigato >
partly, but the goal is to understand how lighting works for VR
17:57
adamholmberg has quit [Ping timeout: 265 seconds]
17:57
<
fijal >
It's a reimplementation of "raytracing in one weekend"
17:57
<
fijal >
There is a book
17:58
<
fijal >
With a few additions (like triangles)
17:59
<
arigato >
it's nice to see effects like "ambient occlusion" showing up automatically
18:02
<
arigato >
if you're looking carefully you can see in the 2nd image that the sun projects shadows, but isn't actually visible (it should show up in the reflection of the sphere)
18:03
<
arigato >
that's because direct shadows are added differently than the rest
18:24
adamholmberg has joined #pypy
18:29
asmeurer has joined #pypy
18:45
adamholmberg has quit [Ping timeout: 244 seconds]
18:52
<
Hodgestar >
What causes the speckling / dithering?
18:54
<
arigato >
Hodgestar: it's because the code is full of random(): one iteration shoots one ray per pixel, which might either be reflected like a mirror, or follow a diffuse lighting model; in the latter case we estimate the incoming light by shooting another ray at a highly random angle
18:55
<
arigato >
and it continues up to a depth of 10 or 12 rays
18:56
<
arigato >
the displayed image is just the mean of all iterations
18:56
<
Hodgestar >
Also, hi. :)
18:57
<
arigato >
I'm running a process with many many iterations, just to see
19:04
<
arigato >
I think there are better ways to remove the speckling, something like filters
19:12
adamholmberg has joined #pypy
19:17
<
arigato >
in a few more years, consumer graphic cards should have the power to do similar images in real time
19:20
<
arigato >
I mean, right now it's maybe just possible to do it, but with a scene that really contains exactly two spheres and one triangle
19:23
<
Hodgestar >
The one with more iterations doesn't look better? (checking my eyes are not fooling me)
19:30
<
arigato >
it does? (it's the first of these two links)
19:30
<
cfbolz >
it's a lot less blurry for me
19:31
<
cfbolz >
arigato: I wonder whether for this kind of thing a faster random would help performance
19:31
<
arigato >
Hodgestar: maybe you're seeing it on a low-res device? try looking at the image in 1:1
19:31
<
arigato >
cfbolz: ah, yes, likely
19:32
adamholmberg has quit [Ping timeout: 248 seconds]
19:32
<
Hodgestar >
I think I might have accidently opened the second URL twice. :)
19:33
<
arigato >
it's crazy how GPUs don't provide a random either, and the common solution is to do something like `frac(large_number * sin(input))`
19:34
<
arigato >
because sin() is just fast
19:34
<
cfbolz >
arigato: is the book by peter shirley?
19:35
<
cfbolz >
he reported that he got 75x speedups by running it on pypy :-)
19:35
<
arigato >
yes, that looks like a similar image
19:36
<
cfbolz >
also he reimplemented the same thing in rust then, but pypy still won
19:37
<
arigato >
heh. I'm seeing some speed variation here that may be due to algorithm, or not
19:37
<
arigato >
e.g. a change that shouldn't change performance makes the program 2x slower
19:38
<
arigato >
so I fear a bit that jitting this kind of code gives very unstable results
19:38
<
arigato >
so it's quite possible that pypy beats rust
*sometimes*
19:39
<
cfbolz >
arigato: well, if the variation is between 75x and only 37x speedup over cpython I'll still take it ;-)
19:39
<
arigato >
obviously :-) but if it's between 1.1x faster and 1.9x slower than rust, that's less clear
19:40
<
cfbolz >
but it was more than 2x faster than rust :P
19:41
<
arigato >
Hodgestar: btw, thanks for pygame_cffi
19:41
<
cfbolz >
ah, nonsense, I can't compute
19:42
<
fijal >
arigato: it took me a few iterations to get pygame_cffi to not suck performance wise
19:42
<
fijal >
(or maybe, to make it blazingly fast)
19:42
<
cfbolz >
1.4x faster only
19:42
<
cfbolz >
then indeed you're right
19:42
<
fijal >
mostly because half of the things I tried were not implemented
19:42
<
fijal >
cfbolz: yes, so the book deals with spheres only and the image is from the book cover
19:42
<
fijal >
I was trying triangles to be more like real graphics
19:43
<
cfbolz >
makes sense
19:43
<
cfbolz >
I am still quite amused that pypy is so good at things that are so unlikely for python-the-language
19:43
<
arigato >
in the end you access some "_pixels_address" on the screen object of pygame
19:44
<
arigato >
and use ffi.cast("char*") on it
19:44
<
arigato >
fwiw I got a few segfault this afternoon
19:44
<
fijal >
yes, that's the fastest
19:44
<
arigato >
I can't reproduce any of them
19:44
<
fijal >
because none of the surface arrays works
19:45
<
fijal >
and direct access is slow
19:47
<
arigato >
I was confused by math.sqrt() when you write a pixel to the screen, can you explain why? (I removed it for the images I pasted)
19:48
<
fijal >
I think that was gamma correction
19:59
<
arigato >
ok, I think gamma-correcting improves the result visually even in this artificial scene
19:59
adamholmberg has joined #pypy
20:15
adamholmberg has quit [Ping timeout: 244 seconds]
20:25
<
Hodgestar >
arigato: Re pygame_cffi: Pleasure! Although I was only one of many people involved (and probably only a medium-ish contributor overall :).
20:27
<
Hodgestar >
arigato, fijal: We should probably organize a sprint here to work on some of the missing parts.
20:36
marky1991 has joined #pypy
20:38
marky1991 has quit [Read error: Connection reset by peer]
20:42
DIRT has quit [Ping timeout: 240 seconds]
20:43
adamholmberg has joined #pypy
21:00
adamholmberg has quit [Ping timeout: 240 seconds]
21:14
asmeurer has quit [Quit: asmeurer]
21:17
Garen has quit [Read error: Connection reset by peer]
21:18
Garen has joined #pypy
21:18
dash_ has joined #pypy
21:18
dash_ is now known as mdash
21:20
asmeurer has joined #pypy
21:27
adamholmberg has joined #pypy
21:35
asmeurer has quit [Quit: asmeurer]
21:36
asmeurer_ has joined #pypy
21:37
asmeurer_ has quit [Client Quit]
21:37
altendky has quit [Quit: Connection closed for inactivity]
21:39
asmeurer__ has joined #pypy
21:44
adamholmberg has quit [Ping timeout: 240 seconds]
22:08
Garen_ has joined #pypy
22:11
Garen has quit [Ping timeout: 264 seconds]
22:12
adamholmberg has joined #pypy
22:28
antocuni has joined #pypy
22:31
adamholmberg has quit [Ping timeout: 240 seconds]
22:38
_whitelogger has joined #pypy
22:38
Kronuz has quit [Ping timeout: 268 seconds]
22:43
Kronuz has joined #pypy
22:43
asmeurer__ has quit [Quit: asmeurer__]
22:51
jcea has quit [Ping timeout: 265 seconds]
22:52
jcea has joined #pypy
22:58
adamholmberg has joined #pypy
23:00
danieljabailey has joined #pypy
23:01
asmeurer__ has joined #pypy
23:09
jamesaxl has quit [Quit: WeeChat 2.1]
23:11
asmeurer__ has quit [Ping timeout: 240 seconds]
23:16
<
njs >
arigato: fijal: sqrt is dubious as a gamma correction method, but you definitely do want some kind of colorspace conversion -- for raytracing you want to work in a space where your values are proportional to the number of photons, and that's not how monitors work
23:18
adamholmberg has quit [Ping timeout: 260 seconds]
23:39
antocuni has quit [Ping timeout: 264 seconds]
23:45
adamholmberg has joined #pypy
23:47
wleslie has joined #pypy