shacklettbp/madrona

How to modify Madrona to support addressing read-write conflicts?

ShawnshanksGui opened this issue · 4 comments

Hello,
I'm aiming to implement some specific systems that might run into read-write conflicts due to multiple-to-one situations. How can I adapt Madrona to support resolving these read-write conflicts? Where should I begin, like which parts of the code should I concentrate on (I've attempted to read the code, but the vast majority of it lacks comments, making it quite strenuous to understand)?
Thanks!

Hi, like I mentioned in the other issue, you should just use atomics: https://github.com/shacklettbp/madrona/blob/main/include/madrona/sync.hpp#L53

Bidipta's blog post talks about using atomics to get more performance in steps 4 and 5: https://bsarkar321.github.io/blog/overcooked_madrona/index.html

Basically you can just put an atomic in a component, and then manage the atomic read-modify-write operations yourself.
Let me know if I'm not answering / misunderstanding your question here.

Internal Madrona support for handling this kind of multiple-to-one situation without relying on the user to use atomics is something we could discuss but it's definitely not trivial and not clear to me what the API should look like. I'm open to suggestions.

Hi, like I mentioned in the other issue, you should just use atomics: https://github.com/shacklettbp/madrona/blob/main/include/madrona/sync.hpp#L53

Bidipta's blog post talks about using atomics to get more performance in steps 4 and 5: https://bsarkar321.github.io/blog/overcooked_madrona/index.html

Basically you can just put an atomic in a component, and then manage the atomic read-modify-write operations yourself. Let me know if I'm not answering / misunderstanding your question here.

Internal Madrona support for handling this kind of multiple-to-one situation without relying on the user to use atomics is something we could discuss but it's definitely not trivial and not clear to me what the API should look like. I'm open to suggestions.

Thanks for sending me this learning material. I appreciate your help and I will definitely take the time to go through it.

Closing, this feel free to reopen if you have further questions.