Description
Context
This issue is a step of #9638 and a sequel of #10364.
In #9638, we want to have extension.Module
as the single source of implementation in pybindings
, which means that pybindings.PyModule
should use extension.Module
rather than its own pybindings.Module
.
The issue is that pybindings.PyModule
is dependent on the method
getter from pybindings.Module
, which extension.Module
do not have. Since we don't want to expose method
getter in extension.Module
, we have to protect the getter, wrap the functions that is dependent on it and use the protected getter there, ultimately decouple pybindings
from a method
getter.
Proposal
Now that we have a protected method_
to use, we can introduce a extension.BundledModule
, a child class inheriting extension.Module
which wraps up bundled program logic that is dependent on the method
getter.
class BundledModule : public Module {
// Load a specific method with the input value at the given `testset_idx` from the bundle to the method.
ET_NODISCARD runtime::Error load_bundled_input(
const std::string& method_name,
const size_t testset_idx);
// Verify the output of a specific method with the expected output from the program bundle at the given `testset_idx`.
ET_NODISCARD inline runtime::Result<bool> verify_output_with_bundled(const std::string& method_name, const size_t bundled_output_index, std::vector<runtime::Evalue>> method_output; other_comparsion_configs);
}