4.5 KiB
Shared request DValue
Changes
src/wasm/core.cppcreates one request DValue on the first handler call. It preserves the root pointer until request reset.- The core refreshes
props,call,unit,out.status,out.headers,out.cookies,session,websocket, andconnectionbefore each handler. - The core preserves all application keys. It restores the caller's
propsandunitvalues after nested handler calls. - The core reads the shared
outvalue after each handler. It applies status, headers, cookies, and the compatiblebufferfield. - The core removed the handler input release hook and per-frame input tracking. Request reset frees the shared handle and payload.
src/capy/compiler.cppimportsbearer_handler_input_dval. The handler prologue passes its borrowed pointer without a retain or release.src/wasm/abi.hsets the core ABI to 34 and the compiler unit ABI to 36.site/tests/capy-request-writeback.capyproves shared application keys and nested response writes. The entry writesrequest.user. The component reads it and writesrequest.pagefacts. The entry reads that key after the call.scripts/test_capy_phase1.shchecks the shared values, nested response changes, restored props, and the new borrowed-parameter ARC counts.scripts/test_capy_native_compiler.cppandscripts/test_capy_native.shcheck the new import.scripts/capy_artifact_golden.sha256records the inspected ABI-wide artifact changes.docs/capy-language.mdspecifies the shared request exception and the Bearer-owned keys.- The request type page, guides 9 and 10, handler pages, unit-call page, and context API pages now describe request keys.
- The
unit_context()andunit_context_set()pages mark both APIs as deprecated. They name application request keys as the replacement. skills/capy-bearer/SKILL.mdnow teaches shared request keys. The installed skill copy also matches it.scripts/generate_capy_docs.pyregenerated the affected files undersite/doc/content/and the documentation search index.
Concurrent work also changed docs/deploy.md and files under editors/vscode/. This task did not edit those source files.
Measurement
The prior recorded result was 1986 microseconds per component call.
The new result was 934.3 microseconds per call. The benchmark made 1,000 component calls in one CLI request. The request contained a 200-key request.application map. The component read key 199 on each call. Fifteen samples ranged from 903.6 to 1041.4 microseconds per call. The median improved by 53 percent.
Gates
Passed:
bash scripts/build_core_wasm.shbash scripts/build_linux.shbash scripts/build_capy.shpython3 scripts/generate_capy_doc_signatures.py --capyc bin/capycpython3 scripts/generate_capy_docs.pybash scripts/test_capy_native.shbash scripts/test_capy_artifact_golden.shafter diff inspectionbash scripts/test_capy_artifact_golden.sh --writebash scripts/test_capy_artifact_golden.shbash scripts/test_capy_reproducible_artifact.shbin/capyc --check site/bin/capyc --format --check site/- Bearer restart and
scripts/systemd/wait-ready.sh bash scripts/test_capy_phase1.shbash scripts/test_capy_guide_examples.shpython3 scripts/check_capy_doc_examples.pypython3 scripts/test_capy_doc_generators.pybash scripts/test_capy_reference.sh- The isolated native CLI runner group
bash scripts/test_wasm_core_smoke.sh
Phase 1 failed while the fixture still expected the old header value. The final run passed after the fixture checked the component's header value.
Not completed
scripts/run_cli_tests.shdoes not expose the requestedhttp,site,security,component, andtaskgroups separately. Its--listoutput contains onlynative. I ran that isolated group. I did not run the complete service-changing suite.- The ludum.live clone failed. Deploy key 31 on this host cannot read
udo/ludum.live. No ludum source was available forcapyc --check --source-root.
No commit or push was made.
Live value representation
The shared request handle now points directly to its core-heap DValue. Refresh and writeback update that object in place. They do not pass request state through BRRB. Request reset deletes the value and frees its 28-byte handle.
The 1,000-call, 200-key component benchmark now has a median of 39,524 microseconds per request, or 39.5 microseconds per call. Five samples ranged from 34,070 to 42,779 microseconds per request. The previous live-request result was 934.3 microseconds per call.