Skip to content

layout reader ctx#8037

Open
onursatici wants to merge 2 commits into
developfrom
os/layout-overrides
Open

layout reader ctx#8037
onursatici wants to merge 2 commits into
developfrom
os/layout-overrides

Conversation

@onursatici
Copy link
Copy Markdown
Contributor

@onursatici onursatici commented May 20, 2026

Summary

Introduce LayoutReaderContext, a typed-data registry threaded through reader construction so an ancestor layout can publish values that descendant layouts look up by type at construction time.

Breaking: Layout::new_reader and VTable::new_reader gain a &LayoutReaderContext parameter. Out-of-tree impls will get a compile error and must add it

Signed-off-by: Onur Satici <onur@spiraldb.com>
@onursatici onursatici requested a review from joseph-isaacs May 20, 2026 14:25
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 20, 2026

Merging this PR will degrade performance by 16.59%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

❌ 1 regressed benchmark
✅ 1236 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_opt_canonical_into[(1000, 10)] 187.7 µs 225.1 µs -16.59%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing os/layout-overrides (e8f8e0d) with develop (008c1d9)

Open in CodSpeed

Signed-off-by: Onur Satici <onur@spiraldb.com>
/// children helpers and survive any single stack frame.
#[derive(Clone, Default)]
pub struct LayoutReaderContext {
values: Arc<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No TypeId please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would that import bug that hit our use of type id be relevant for this type of use as well? I can use the layout id here, I think it is a bit of a weirder api to have but should work

Copy link
Copy Markdown
Contributor

@joseph-isaacs joseph-isaacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a Array like Id instead of a TypeId

@gatesn
Copy link
Copy Markdown
Contributor

gatesn commented May 26, 2026

What's wrong with TypeId? We use this structure for all ephemeral context objects, i.e. VortexSession.

It works correctly, is very fast, and helps keep it clear that this stuff is never serialized.

The general Id is more used for things that are serialized and then later looked up in a registry on the other end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants