hero_rpc#122: codegen fixes + osis benches + ClientT impl #125
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_rpc!125
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-122-template-revalidation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #122 (Phases 1, 3, 4 — Phase 2 lives in
lhumina_code/hero_service#issue-122-template-revalidation).
Codegen / template fixes surfaced by re-validating the canonical
hero_servicetemplate against the current generator, plus thecriterion benchmark harness this issue exists to produce.
What changed
Codegen / scaffolder fixes
generator/build/scaffold.rs.with_wasm()from emittedbuild.rs(config method removed in #114).generator/build/scaffold.rshero_rpc2+jsonrpsee(proc-macro expansion needs both) and a build-dep edge on the core crate so cargo waits for codegen before compiling the SDK.generator/build/scaffold.rslib.rsstub now exposespub mod generated; pub use generated::*;.generator/build/scaffold.rstests/src/lib.rsuses concreteArc<Client>(jsonrpsee 0.26'sClientTis not dyn-compatible) and aServiceHandle::shutdown()method that the emitted e2e tests call.generator/build/ui_emit.rscreateroute uses_new(input) -> sid(the #117 shape), not_set(obj).FieldKind::Jsonform fields parse back viaserde_json::from_strinstead of assigningStringtoVec<…>.generator/generate/rust_server.rsnested_layoutpushes the core import one super deeper, the handleruse super::super::super::*line now finds the right anchor instead of getting injected above the module doc comment.generator/rust/rust_struct.rsOtomlSerializeimport from the emittedtypes.rs— thepub use … as _re-export covers it.generator/rust/rust_osis.rsOsisAppRpcHandler::type_names()and thehandle_rpcmatch arms use snake_case (indexed_multi.new), matchingOsisObject::type_name()and the SDK trait#[method(name = "…")]annotations. Multi-word rootobjects were failing withMethodNotFoundon the wire path.hero_rpc2/src/client.rsimpl ClientT for hero_rpc2::Clientso the generated SDK trait methods extend straight offArc<Client>— the existingDereftoInnerClientdidn't help trait-method dispatch.Benchmark harness
New
crates/osis_benches/— criterion harness covering five cases:set_throughput,get_by_sid_latency,query_indexed_vs_full_scan(headline),query_multi_index,index_build_from_empty. Spins up the OSIS server viahero_rpc_osis::rpc::bootstrap::run_for_testso it exercises thesame path production binaries take.
BENCH_RESULTS.md(committed at the repo root) captures real numbersfrom a local run on an M1 MacBook Pro.
Headline number
query_indexed_vs_full_scanat 5 000 rows, sameIndexedSingledataset on both arms, probe word
"Aurora":shadow_indexed.title(HashMap built fromindexed_fields())@indexwould buy once OSIS consults itfull_scan.title(list_full() + filter())~90× gap. That's the budget a real
indexed_fields-consumingstorage backend has to play in. The current OSIS code path never
calls
indexed_fields()and the SDK trait emits no_find_*method — so the entire 90× is on the table waiting to be claimed
by the follow-up issue.
Acceptance criteria
From #122:
cargo build --workspaceclean, zero warnings. (Verified locally; one pre-existing unused-import incrates/osis/examples/basic/code/was already broken ondevelopmentand is not from this branch.)cargo test --workspace --lib --binsclean — 318+ unit tests pass.IndexedNone/IndexedSingle/IndexedMulti/IndexedNonStr(inhero_service— see the paired PR).OsisObject::indexed_field_names()correct on all four rootobjects.BENCH_RESULTS.mdcommitted;query_indexed_vs_full_scanmeasurable gap.feedback_commit_attribution.md).Decisions taken without confirmation
crates/osis_benches/crate rather thancrates/osis/benches/so the codegen pipeline runs throughbuild.rs(matching consumer service shape). Pro: every generated service inherits the pattern. Con: an extra workspace member.@indexis metadata-only — benchmark shows a shadow-index ceiling, not a wire-path number. Per #122's "real numbers, not theatrical ones" rule, this is the honest finding. The follow-up issue #123 is the actual fix.MultiDomainBuilderextraction deferred to the alignment follow-up #124, so the workspace-roottests/src/lib.rstemplate still hand-rolls its registration ladder for two domains.Follow-ups not done here
@indexintegration: wirefind_*throughhero_indexerwith typed<RootObject>FindParams. The 90× gap above is the motivation.spin_up_serviceduplication into aMultiDomainBuilder+ ship the nushelltests/smoke.nu/tests/api_integration.nuLayer-2/3 scripts thetests_pyramidskill describes.Test plan
cargo build -p hero_rpc_generatorclean.cargo test --workspace --lib --binsclean.cargo bench -p hero_rpc_osis_benches --bench index_perf -- --quickproduces criterion output and the headline gap above.🤖 Generated with Claude Code