This is an archive of the discontinued LLVM Phabricator instance.

Rebase D148288 and associated test commits by jhuber6 on D148191
Needs ReviewPublic

Authored by JonChesterfield on Apr 17 2023, 7:17 PM.

Details

Summary

[Not to land] Rebase D148288 and associated tests on D148191

Apologies for the sequence of commits mashed together, I don't know how to untangle
them in phab from the github fork Joseph pointed me to. This isn't a patch to land,
creating for discussion. It's also somewhat messy - the interface from D148288,
namely alternating send/recv model - and the state in the Port instance are unchanged
and don't mesh particularly cleanly with the previous patch.

Handle server leaks ports in D148288, could have been a compile time error
Odd number of send/recv calls in D148288 will leave ports that can never be opened again
The ack/data distinction is not necessary to encode the desired send/recv model

Tests pass as before. The simplified bitmap hacked together for D148585 doesn't work so
this patch uses the real one.

Primary change is to drop the ack/data distinction in favour of inbox==outbox implies
ownship and inbox != outbox implies the other process owns the buffer. This seems to be
the primary difference in modelling the domain between the two patches.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 17 2023, 7:17 PM
JonChesterfield requested review of this revision.Apr 17 2023, 7:17 PM

The differentials spliced together here from Joseph are, I think, D148288, D148342, a commit to add --threads and --blocks to the loaders, test the rpc interface with multiple blocks. That was the most tested / working baseline to hack this together on top of. Essentially everything in this patch which is not a direct copy from D148288 is from @jhuber6 with pretty minimal glue/interface patches to splice the two together. This is mostly an existence proof that the four bit machine is not necessary to express the send/recv/send/recv API.

libc/src/__support/RPC/rpc.h
379

codegen around this branch is probably a mess, written like this for clarity of exposition not for performance. In particular clang probably inlines the functor twice and will need hand holding to avoid that. Or raise outbox to a compile time parameter as I prefer and it'll fold correctly