Skip to content

Pass immutable data to ScalingEngines - #172

Draft
lforchini wants to merge 1 commit into
bugfix/stop-backend-util-reportfrom
immutable-data-scaling-engine
Draft

lforchini wants to merge 1 commit into
bugfix/stop-backend-util-reportfrom
immutable-data-scaling-engine

Conversation

@lforchini

Copy link
Copy Markdown
Collaborator

The controller constructs a struct from tracking mutable state and
backend collected performance counters which it then passes to the
engine. Previously the engine was given a reference to the Instance
itself, potentially allowing the engine to bypass the controller. Now,
only the controller can command the Instance with the engine advising
the controller.

This split also makes testing easier. Instead of having to construct
full Instances, now only fake data needs to be passed to the engine to
evaluate its decisions.

AI-Generated: most of it
Signed-off-by: Leonardo Forchini leonardo.forchini@nutanix.com


Stack created with GitHub Stacks CLI • Give Feedback 💬

@lforchini
lforchini added this pull request to stack #173 October 30, 2026 10:50
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 7547ebb to 5ac1df8 Compare October 30, 2026 10:55
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 5ac1df8 to 395ca81 Compare October 30, 2026 11:22
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 395ca81 to 498e87a Compare October 30, 2026 11:43
@lforchini
lforchini removed this pull request from stack #173 November 5, 2026 15:02
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 498e87a to 0398141 Compare November 5, 2026 15:03
@lforchini
lforchini added this pull request to stack #176 November 5, 2026 15:03
@lforchini
lforchini removed this pull request from stack #176 November 5, 2026 15:09
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 0398141 to 5a6a530 Compare November 5, 2026 15:10
@lforchini
lforchini marked this pull request as ready for review November 5, 2026 15:10
@lforchini
lforchini added this pull request to stack #178 November 5, 2026 15:10

@tmakatos tmakatos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There's a lot of unrelated changes here.

Comment thread src/backends/fake/mod.rs
const BACKEND_NAME: &str = "fake";

fn build_fake_backend(dir: &Path) -> Result<Box<dyn Backend>, BackendClientError> {
fn build_fake_backend(dir: &PrefixedPath) -> Result<Box<dyn Backend>, BackendClientError> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PrefixedPath changes are unrelated.

Comment thread src/engines/mod.rs

/// Immutable, controller-processed input for one engine evaluation.
#[derive(Debug, Default, Clone)]
pub struct EngineInstanceSnapshot {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not just InstanceSnapshot?

Comment thread src/engines/threshold.rs
impl InstanceState {
/// Create lifecycle state for the exact controller instance.
fn new(instance: Arc<Instance>) -> Self {
/// Create lifecycle state for one controller-owned instance.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

unrelated change

@lforchini

Copy link
Copy Markdown
Collaborator Author

Oh, this one should still be a draft, sorry about that

@lforchini
lforchini marked this pull request as draft November 6, 2026 09:05
@lforchini
lforchini removed this pull request from stack #178 November 6, 2026 10:23
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 5a6a530 to 6c0dc53 Compare November 6, 2026 10:24
@lforchini
lforchini added this pull request to stack #180 November 6, 2026 10:24
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch 5 times, most recently from 3487a88 to 5f83de4 Compare November 11, 2026 11:49
The controller constructs a struct from tracking mutable state and
backend collected performance counters which it then passes to the
engine. Previously the engine was given a reference to the Instance
itself, potentially allowing the engine to bypass the controller. Now,
only the controller can command the Instance with the engine advising
the controller.

This split also makes testing easier. Instead of having to construct
full Instances, now only fake data needs to be passed to the engine to
evaluate its decisions.

AI-Generated: most of it
Signed-off-by: Leonardo Forchini <leonardo.forchini@nutanix.com>
@lforchini
lforchini force-pushed the immutable-data-scaling-engine branch from 5f83de4 to 9d75264 Compare November 11, 2026 14:27
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.

2 participants