Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/network rendering #101

Merged
merged 70 commits into from
Apr 8, 2021
Merged

Feature/network rendering #101

merged 70 commits into from
Apr 8, 2021

Conversation

vkoskiv
Copy link
Owner

@vkoskiv vkoskiv commented Apr 5, 2021

This is starting to look like it's good to merge now. Few more TODOs:

  • Test that the windows build actually functions (For now I just checked that it builds)
  • Split protocol.c into separate worker/master files
  • Clean up the protocol implementation. Lots of redundant logic/state in there from the various iterations.
  • Debug, and test protocol portability. For now I verified that connections don't seem to work from x86 -> PowerPC systems, but they do work the other way around

I just now decided to go with a different approach. Instead of having
whole separate codepaths for managing a network-enabled render, I'll
just have network-enabled render threads that poke at the worker clients
to get their work done. Should integrate better with the rest of the
system.
Right now networking.c contains a lot of the previous approach I was
trying, that will go away, probably.
Just stashing these changes in version control now in case my computer
crashes.
Test suite needs to be expanded, obviously.
Implementations lifted from stackoverflow here:
https://stackoverflow.com/questions/342409/how-do-i-base64-encode-decode-in-c

The implementations chosen are far faster than anything I could ever
come up with.
Was kind of confusing to just see nothing happen when invoking
run-tests.sh
It was just indexing into the wrong array when printing the name.
It now sends a header of the message size as a 64 bit integer in network
byte order, and then sends the message content in 1kB chunks.
Seems to work, but I wouldn't be surprised if there were some bugs in
there still.
Also set it back to doing some protocol messaging.
It's starting to exchange messages, but there is something wrong with
state encoding.
I'm pushing these now because I'm going mobile for the weekend.
Didn't allocate enough bytes for the output buffer.
The default buffer is 512 characters. Print any more than that and you
get ellipsis at the end, indicating there would have been more text.

This confused me much when I started debugging the protocol by printing
the sent/received data using logr(). I forgot it was intended purely for
short status messages, not for printf() debugging.
Won't be using them, I think.
Also remove some debug prints that are no longer needed.
Sync mostly works now, but we need a nice solution for on-disk assets.
I'm thinking of a fscache module where files can be stored in key-value
pairs of type path-file.
This is used to easily send assets to worker nodes over the wire.
Was having some connection reset issues, this might help.
Stitch together the chunk if we didn't get it all on the first call to
recv()
Also patch up base64 to fix an asan error
It's not available on linux, and might not be needed. I just added it
before to try and resolve connection issues.
Settings like image or tile dimensions and sample count must match those
of the master node, otherwise the resulting image will not turn out
right.
@vkoskiv vkoskiv mentioned this pull request Apr 5, 2021
3 tasks
@vkoskiv vkoskiv linked an issue Apr 6, 2021 that may be closed by this pull request
3 tasks
Split up protocol.c into server.c and worker.c
Still very rough, just split it up and fixed build errors.
Would be useful if MSVC reported more than 1-3 errors at a time.
For scenes that load the same asset more than once, it just got stuffed
in the cache multiple times, and worse, sent over the wire to every
client. This patch fixes that - no more redundant data.
Just some status updates while assets are being transferred, since it
can take a while.
And apply it to texture loading as well.
256 was a bit small for path length there.
For some reason unknown to me at this time, building with MSVC in
Release mode causes c-ray to crash when evaluating materials. This will
need to be debugged further, but for now we can disable alpha blending
on Windows so it can at least render something without crashing.
New windows build instructions (the build works again)
Link to network rendering doc
@vkoskiv vkoskiv merged commit e0f2cc8 into master Apr 8, 2021
@vkoskiv vkoskiv deleted the feature/network_rendering branch April 8, 2021 22:22
@vkoskiv vkoskiv mentioned this pull request Apr 8, 2021
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.

Implement cluster rendering
1 participant