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
DIRT has quit [Remote host closed the connection]
adamholmberg has quit [Ping timeout: 264 seconds]
adamholmberg has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.1]
adamholmberg has quit [Ping timeout: 244 seconds]
adamholmberg has joined #pypy
dddddd has quit [Remote host closed the connection]
oberstet has quit [Ping timeout: 240 seconds]
asmeurer_ has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
altendky has joined #pypy
adamholmberg has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
asmeurer_ has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
adamholmberg has quit [Ping timeout: 244 seconds]
DIRT has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
DIRT has quit [Remote host closed the connection]
DIRT has joined #pypy
adamholmberg has joined #pypy
altendky has quit [Quit: Connection closed for inactivity]
adamholmberg has quit [Ping timeout: 264 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 264 seconds]
adamholmberg has joined #pypy
_whitelogger has joined #pypy
adamholmberg has quit [Ping timeout: 260 seconds]
adamholmberg has joined #pypy
oberstet has joined #pypy
dddddd has joined #pypy
jamesaxl has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
adamholmberg has joined #pypy
DIRT has quit [Ping timeout: 264 seconds]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 256 seconds]
adamholmberg has joined #pypy
jcea has joined #pypy
jcea has quit [Client Quit]
jcea has joined #pypy
TheAdversary has quit [Read error: Connection reset by peer]
Hasimir has quit [Read error: Connection reset by peer]
TheAdversary has joined #pypy
Hasimir has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
antocuni has joined #pypy
adamholmberg has joined #pypy
jiffe has quit [Quit: WeeChat 2.1]
jiffe has joined #pypy
nunatak has joined #pypy
nunatak has quit [Quit: Leaving]
adamholmberg has quit [Ping timeout: 260 seconds]
adamholmberg has joined #pypy
realitix has joined #pypy
realitix has quit [Client Quit]
adamholmberg has quit [Ping timeout: 260 seconds]
asmeurer has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 264 seconds]
antocuni has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 264 seconds]
antocuni has joined #pypy
adamholmberg has joined #pypy
DIRT has joined #pypy
antocuni has quit [Ping timeout: 260 seconds]
adamholmberg has quit [Ping timeout: 240 seconds]
asmeurer has quit [Quit: asmeurer]
asmeurer_ has joined #pypy
adamholmberg has joined #pypy
asmeurer_ has quit [Quit: asmeurer_]
jcea1 has joined #pypy
jcea has quit [Remote host closed the connection]
jcea1 is now known as jcea
adamholmberg has quit [Ping timeout: 264 seconds]
altendky has joined #pypy
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 260 seconds]
asmeurer has joined #pypy
asmeurer has quit [Ping timeout: 248 seconds]
adamholmberg has joined #pypy
<arigato> 1000x500 raytraced image computed in less than 1 minute by pypy: https://slack-files.com/T873Z9J5A-FBQA0P7PB-dd9f8d64e5
<arigato> same, with a bit of reflection: https://slack-files.com/T873Z9J5A-FBQSF9DMY-c691ae42bb
<cfbolz> arigato: nice!
<cfbolz> I was going to ask whether it was you who wrote that, then I saw the window decorations :-)
<arigato> :-)
<arigato> it's mostly fijal actually, but I "finished" it
<cfbolz> Nice
<cfbolz> Just for the fun of it?
<arigato> partly, but the goal is to understand how lighting works for VR
adamholmberg has quit [Ping timeout: 265 seconds]
<fijal> It's a reimplementation of "raytracing in one weekend"
<fijal> There is a book
<fijal> With a few additions (like triangles)
<arigato> it's nice to see effects like "ambient occlusion" showing up automatically
<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)
<arigato> that's because direct shadows are added differently than the rest
adamholmberg has joined #pypy
asmeurer has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
<Hodgestar> What causes the speckling / dithering?
<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
<arigato> and it continues up to a depth of 10 or 12 rays
<Hodgestar> Woot.
<arigato> the displayed image is just the mean of all iterations
<Hodgestar> Also, hi. :)
<arigato> hi :-)
<arigato> I'm running a process with many many iterations, just to see
<arigato> I think there are better ways to remove the speckling, something like filters
<arigato> https://slack-files.com/T873Z9J5A-FBQKF05BN-c2669ac671 << same image with less iterations
adamholmberg has joined #pypy
<arigato> in a few more years, consumer graphic cards should have the power to do similar images in real time
<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
<Hodgestar> The one with more iterations doesn't look better? (checking my eyes are not fooling me)
<arigato> it does? (it's the first of these two links)
<cfbolz> it's a lot less blurry for me
<cfbolz> arigato: I wonder whether for this kind of thing a faster random would help performance
<arigato> Hodgestar: maybe you're seeing it on a low-res device? try looking at the image in 1:1
<arigato> cfbolz: ah, yes, likely
adamholmberg has quit [Ping timeout: 248 seconds]
<Hodgestar> I think I might have accidently opened the second URL twice. :)
<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))`
<cfbolz> eh
<arigato> because sin() is just fast
<cfbolz> arigato: is the book by peter shirley?
<arigato> fijal: ?
<cfbolz> if yes, david beazly was working through it recently too, it seems: https://twitter.com/dabeaz/status/1002292935956758528
<cfbolz> he reported that he got 75x speedups by running it on pypy :-)
<arigato> yes, that looks like a similar image
<cfbolz> also he reimplemented the same thing in rust then, but pypy still won
<arigato> heh. I'm seeing some speed variation here that may be due to algorithm, or not
<arigato> e.g. a change that shouldn't change performance makes the program 2x slower
<arigato> so I fear a bit that jitting this kind of code gives very unstable results
<arigato> so it's quite possible that pypy beats rust *sometimes*
<cfbolz> arigato: well, if the variation is between 75x and only 37x speedup over cpython I'll still take it ;-)
<arigato> obviously :-) but if it's between 1.1x faster and 1.9x slower than rust, that's less clear
<cfbolz> maybe
<cfbolz> but it was more than 2x faster than rust :P
<arigato> :-)
<arigato> Hodgestar: btw, thanks for pygame_cffi
<cfbolz> ah, nonsense, I can't compute
<fijal> arigato: it took me a few iterations to get pygame_cffi to not suck performance wise
<fijal> (or maybe, to make it blazingly fast)
<cfbolz> 1.4x faster only
<cfbolz> then indeed you're right
<fijal> mostly because half of the things I tried were not implemented
<fijal> cfbolz: yes, so the book deals with spheres only and the image is from the book cover
<cfbolz> ok
<fijal> I was trying triangles to be more like real graphics
<cfbolz> makes sense
<cfbolz> I am still quite amused that pypy is so good at things that are so unlikely for python-the-language
<arigato> in the end you access some "_pixels_address" on the screen object of pygame
<arigato> and use ffi.cast("char*") on it
<arigato> fwiw I got a few segfault this afternoon
<fijal> yes, that's the fastest
<arigato> I can't reproduce any of them
<fijal> because none of the surface arrays works
<fijal> and direct access is slow
<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)
<fijal> I think that was gamma correction
<arigato> ah
<arigato> ok, I think gamma-correcting improves the result visually even in this artificial scene
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 244 seconds]
<Hodgestar> arigato: Re pygame_cffi: Pleasure! Although I was only one of many people involved (and probably only a medium-ish contributor overall :).
<Hodgestar> arigato, fijal: We should probably organize a sprint here to work on some of the missing parts.
marky1991 has joined #pypy
marky1991 has quit [Read error: Connection reset by peer]
DIRT has quit [Ping timeout: 240 seconds]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
asmeurer has quit [Quit: asmeurer]
Garen has quit [Read error: Connection reset by peer]
Garen has joined #pypy
dash_ has joined #pypy
dash_ is now known as mdash
asmeurer has joined #pypy
adamholmberg has joined #pypy
asmeurer has quit [Quit: asmeurer]
asmeurer_ has joined #pypy
asmeurer_ has quit [Client Quit]
altendky has quit [Quit: Connection closed for inactivity]
asmeurer__ has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
Garen_ has joined #pypy
Garen has quit [Ping timeout: 264 seconds]
adamholmberg has joined #pypy
antocuni has joined #pypy
adamholmberg has quit [Ping timeout: 240 seconds]
_whitelogger has joined #pypy
Kronuz has quit [Ping timeout: 268 seconds]
Kronuz has joined #pypy
asmeurer__ has quit [Quit: asmeurer__]
jcea has quit [Ping timeout: 265 seconds]
jcea has joined #pypy
adamholmberg has joined #pypy
danieljabailey has joined #pypy
asmeurer__ has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.1]
asmeurer__ has quit [Ping timeout: 240 seconds]
<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
<njs> if you want to do it the fancy way, https://colorspacious.readthedocs.io/ can convert between "sRGB1-linear" for your working space and "sRGB255" for display
adamholmberg has quit [Ping timeout: 260 seconds]
antocuni has quit [Ping timeout: 264 seconds]
adamholmberg has joined #pypy
wleslie has joined #pypy