hanatos / corona-13

cpu path tracing test bed
GNU General Public License v3.0
43 stars 1 forks source link

Veach-style MLT? #1

Open ib00 opened 2 years ago

ib00 commented 2 years ago

Where is Veach-style MLT?

Is there a good corona-13 test scene for it?

hanatos commented 2 years ago

heya,

veach mlt source code can be found in this file: https://github.com/hanatos/corona-13/blob/master/src/pathspace/vmlt.c

it depends on a set of mutation strategies defined in vmlt_registry or so. you create that by listing the mutations in config.mk under MUTATIONS=. there are a couple regression tests about this, they may certainly serve as entry points to config.mk files.. but i'm very much unsure any of this currently works (this is research code as you'll notice).

for instance see this one: https://github.com/hanatos/corona-13/blob/master/regression/0020_hslt/config.mk

which can hopefully be run by cd regression/ && make 0020, but i doubt it. the config.mk in the regression directory probably lacks at least the module line for the light list/next event estimation thing (copy it over from the top level config.mk.example). the regression tests should create a website report such as this one: https://jo.dreggn.org/home/regression/report.html .

if the regression tests themselves don't have all the geometry (i think the basic test scene should be there) you can try to run regression/get_data.sh or use the blender exporter in tools/blender/ to create your own.

hope that helps, and good luck.

ib00 commented 2 years ago

Thanks for clarification.

I have looked at the mutation strategies (vmlt_*.h files). What is 'vmlt_hmc' mutation? I also couldn't find 'bidirectional' mutation. Is that implemented? That's one mutation strategy I had lots of trouble implementing myself (in my framework).

hanatos commented 2 years ago

hmc: was a hamiltonian monte carlo experiment. didn't work all that well in the general setting so it's probably rotten code.

bidirectional: this mutation strategy is expected to be there for ergodicity, but it's terrible and has a very low acceptance rate. i decided it wasn't worth the trouble and i'm using kelemen style large steps (completely independent samples) to satisfy ergodicity instead.

ib00 commented 2 years ago

I understand that you can just generate completely new chain (ie, "large step mutation") to ensure ergodicity.

The tricky parts about Veach's bidirectional mutation are:

  1. transition probability is not symmetric
  2. the chain length after mutation can be different

1 is a lot of work to get right for such a bad mutation, so I understand why just generating new chain

(and having symmetric transition probability) make sense.

Questions:

  1. How do you decide (and compute probabilities) for the (new) chain length?
  2. Does non-symmetry matter in practice?