Open ericniebler opened 11 months ago
Comment by lewissbaker Tuesday Dec 28, 2021 at 23:50 GMT
Also, we need to add a requirement that customisations must complete with set_value(out_r, args...)
.
And also that if s
completes with set_error
or set_done
that this result is forwarded through as the result of the bulk operation and that f
is not invoked.
The current wording of bulk
in P2300R10 seems to only require that the function, f
, satisfies movable-value
. This means that the implementation of bulk cannot guarantee that the decay-copied f
can actually be copied to different execution-agent-local storage.
Is the intent that only a single f
instance is invoked from multiple execution-agents?
i.e. are customisations allowed to copy f
if it is copyable? This would be observable if it does.
or are customizations required to always invoke the same f
instance?
It seems like we need to be clearer in the wording about what we want to allow here.
And also that if
s
completes withset_error
orset_done
that this result is forwarded through as the result of the bulk operation and thatf
is not invoked.
I don't think this is feasible. bulk
may invoke f
several times before it encounters an error/stopped condition and it's forced to complete with set_error
/set_stopped
.
Issue by lewissbaker Tuesday Dec 28, 2021 at 23:47 GMT Originally opened as https://github.com/NVIDIA/stdexec/issues/341
The current wording indicates that when the input sender sends
args
that customisations ofbulk
must invokef(i, args...)
for eachi
in 0..shape.However, if the customisation of
bulk
wants to executef
on some other context it will need to be done asynchronously and thus the implementation will need to decay-copyargs
to some temporary storage in the operation-state so that they are still available whenf
is to be invoked.Should the wording be made explicit here that
f
is allowed to be invoked with a decay-copied version ofargs...
instead of the sameargs...
that were passed toset_value()
? If so, should the bulk operation be required to complete with a pack of values with the same value category as the predecessor completed with, or is completing with xvalues referencing the decay-copied versions an acceptable transformation of the value-channel for bulk implementations that need to decay-copy the args?Also, should we be explicit that
f
is invoked with lvalue references toargs...
or the decay-copiedargs...
? If so, are customisations required to pass the same lvalues to each invocation off
?` If so can we clarify that in the wording too?