Changes in safe mode on unforked notebooks of others are not preserved


  • open someone else’s notebook in safe mode
  • make some changes
  • click exit
  • changes have disappeared

I discovered this after spending half an hour optimizing one of @Fil’s notebooks :frowning:

Then again, I accessed safe mode by typing it in the URL, just noticed that it isn’t easily accessible from a menu. So I guess safe mode was not intended to be accessed anywhere outside your own notebooks? In that case maybe block it on notebooks that are not your own? Or even better: show a “it looks like you’re accessing safe mode on someone else’s notebook, you can only do that on your own. Fork this notebook and open in safe mode?” page instead.

1 Like

oh no! :cold_face:

1 Like

Double oh-no!

I’m not sure what our solution will be to that, but I’ve filed a bug so we can keep track of the problem. Thanks for letting us know, and sorry you lost your work.

1 Like

No worries, I tried again later, making sure to use a forked notebook this time:

The only real significant change is that I inlined the dot product and the random direction function, and in the latter case also stopped allocating a new float array every time you called the function (did you know that typed array allocation is insanely slow?)


Excellent! I’ve reworked quite a bit on the notebook (my daughter needed it to calibrate the colors of the film she’s currently editing), and created a new notebook that applies the Sliced OT method and exports a LUT. I’ll try and apply your optimizations there too.

Here’s the notebook as a standalone tool (just an embed), and a video showing the workflow with DaVinci Resolve:

the source notebook is here:

I’m still editing some parameters to see what’s important in terms of quantity of pixels that we try to transport, the color model (RGB vs LAB), etc.

In particular the neural network that tries to generalize the mapping (source image => target image) is not very performant. I just used brain.js as a black box, I have no idea how to make it better.

To visualize the LUTs you can upload them into (made by someone from the same workshop).


However you handle this problem, please don’t block access to safe mode. It is the only way to reliably use find-in-page on a notebook.


Very, very cool

By the way, I’ve added some more optimizations:

  • inlined project_pixels completely. Surprisingly enough this had an effect!
  • we need an “indirect” sort for p, but not for q. On top of that I happened to have an unpublished conveniently semi-finished notebook on radix sort lying around that’s somewhat faster than the native sorts for bit typed arrays, and can take advantage of nearly-sorted arrays, so I added that too.

I’ve also been trying to get the radix sort to work with indices as well, but while it seems to be doing OK in separate tests it breaks the algorithm when I apply it to your notebook.

the second radix notebook isn’t shared I suppose?

Gah, my brain is all over the place this week. I mean even more than usual. It’s shared now!