Skip to content

Conversation

@anutosh491
Copy link
Collaborator

Description

As the smallpt notebook was removed, I'm taking this chance to add a better example imo here.

  1. We dropped the SDL support along with smallpt which is great as SDL wasn't contributing much and we also reduce the size of xcpp.data so yeah faster loading. This doesn't mean we can't have the smallpt example in the notebook. Recreating it should be trivial.
  2. But smallpt takes about 7 hours to generate a crystal clear image, and we were running it for about 2 mins to have a very poor image.
  3. I've replaced it with an equally popular choice for ray tracing taught as a part of a university course (https://github.com/ssloy/tinyraytracer/wiki). Much better image in just 15 seconds and plain C++
image

Type of change

Please tick all options which are relevant.

  • Bug fix
  • New feature
  • Added/removed dependencies
  • Required documentation updates

@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.94%. Comparing base (6cad0a4) to head (556c776).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #426   +/-   ##
=======================================
  Coverage   81.94%   81.94%           
=======================================
  Files          21       21           
  Lines         853      853           
  Branches       87       87           
=======================================
  Hits          699      699           
  Misses        154      154           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcbarton
Copy link
Collaborator

mcbarton commented Dec 4, 2025

My comments on this PR are

  1. The notebook needs adding to the deployment and documentation

  2. If you look at the faq for license the ray tracer example has here https://www.wtfpl.net/faq/ , you'll see it says 'The WTFPL lets you relicense the work under any other license.' . To me this says we can have the code in the repo under the bsd 3 of the rest of repo, so may not need to licence file added. This is not legal advice though. Just thought I'd bring it up so others can discuss.

@anutosh491
Copy link
Collaborator Author

Ahh perfect, if I can get rid of this weird license that would be awesome. I'll just get rid of it if that's how it's supposed to work

@anutosh491 anutosh491 force-pushed the tinyraytracer branch 2 times, most recently from 9c32875 to 353438b Compare December 5, 2025 09:29
@anutosh491
Copy link
Collaborator Author

This is ready from my end if someone can help me with the merge !

@mcbarton
Copy link
Collaborator

mcbarton commented Dec 5, 2025

@anutosh491 2 quick questions before I approve.

  1. The title of the notebook is 'Tiny Ray Tracer in xeus-cpp-lite'. Does this example not work for the native kernel? Nothing in the notebook stood out to be as to why it would only work for the Emscripten kernel.

  2. Little bit of nit pick but do we need

The tutorial builds a ray tracer step-by-step, starting from basic vector math and gradually introducing spheres, materials, shadows, reflections, refractions, and finally global illumination.

The implementation in this notebook corresponds to Step 9 of the tutorial series, and can be extended further as an assignment toward Step 10, producing a more advanced final render.

in the notebook. It feels sufficient that we already pointed the user towards the tutorial series with a link.

@anutosh491
Copy link
Collaborator Author

The title of the notebook is 'Tiny Ray Tracer in xeus-cpp-lite'. Does this example not work for the native kernel? Nothing in the notebook stood out to be as to why it would only work for the Emscripten kernel.

Ahh yess it should just work right ? Haven't given it a shot !

Little bit of nit pick but do we need

Well this covers step 9 -> I plan to advertise our notebook to the professor behind this once this goes in and have it hosted on his repo -> it has 5k+ stars and good traffic so I'm guessing more students will try it out and report back -> as soon as someone cracks step 10 which is a much better notebook -> we update to step 10 !

@anutosh491
Copy link
Collaborator Author

anutosh491 commented Dec 5, 2025

Ahh yess it should just work right ? Haven't given it a shot !

Works perfectly as we want it to

image

I'll just edit the xeus-cpp-lite to xeus-cpp in the heading !

@anutosh491
Copy link
Collaborator Author

I'll just edit the xeus-cpp-lite to xeus-cpp in the heading !

Done.

@mcbarton
Copy link
Collaborator

mcbarton commented Dec 5, 2025

Just approved but I think it should be 'Tiny Ray Tracer using xeus-cpp' and not 'Tiny Ray Tracer in xeus-cpp'. Feel free to merge though if your ok with what it is.

@anutosh491
Copy link
Collaborator Author

Just approved but I think it should be 'Tiny Ray Tracer using xeus-cpp' and not 'Tiny Ray Tracer in xeus-cpp'. Feel free to merge though if your ok with what it is.

We had "smallpt in xeus-cpp" if you remember, so probably I just used that :~)

@anutosh491 anutosh491 merged commit 778e639 into compiler-research:main Dec 5, 2025
16 checks passed
@anutosh491 anutosh491 deleted the tinyraytracer branch December 5, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants