Skip to content

[codex] ban read func#8

Draft
MilkBlock wants to merge 8 commits intostablefrom
experimental
Draft

[codex] ban read func#8
MilkBlock wants to merge 8 commits intostablefrom
experimental

Conversation

@MilkBlock
Copy link
Copy Markdown
Owner

This PR removes the macro-generated ctx.read_* / ctx.try_read_* helpers from stable-side #[eggplant::func] rule contexts and rewrites the remaining read sites to query/pattern style.

The old read helpers let rule actions reach into function tables directly. That is a poor fit for stable because the lookup happens in the closure path instead of the pattern/query phase, and the try_read_* fallback path makes the semantics uneven. This change deletes read-helper generation entirely, keeps the set_* API, and moves reads into the rule pattern where the function result is bound and devalued explicitly. There is no fallback path left.

Updated call sites include the read smoke test and fib demo in src/test.rs, examples/func_read_complex.rs, and the bench cases under benches/runners/eggplant_rewrite/.

Validation:

  • cargo fmt --all --check
  • cargo build --example func_read_complex --locked
  • cargo test --lib func_ctx_query_smoke -- --nocapture
  • cargo test --bench ci_benchmarking --no-run --locked

Make tx_rx_vt_pr-generated Tx facades resolve through explicit sessions or a default fallback session instead of a process-wide true singleton.

This lifts the pseudo-singleton runtime from example-local prototype code into src/instances, updates the macro expansion to generate session-aware facades, migrates the constant-prop pseudo-singleton examples to the library API, and adds regression tests for session isolation, async routing, and reset-for-bench behavior.

Focused verification:
- cargo test --test session_aware_tx --test pseudo_singleton_constant_prop
- cargo run --example constant_prop_pseudo_singleton
- cargo run --example constant_prop_pseudo_singleton_async
- subagent review: no findings
Make session routing the default Tx story in user-facing names.

This removes the pseudo-prefixed example and test filenames, deletes examples/support, renames the internal runtime module to session_runtime, and updates README copy to describe sessions as the default Tx behavior rather than a separate pseudo-singleton mode.

Focused verification:
- cargo test --test tx_sessions --test session_tx_constant_prop
- cargo run --example constant_prop_sessions
- cargo run --example constant_prop_sessions_async
- subagent review: no findings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant