Skip to content

Conversation

@julio4
Copy link
Collaborator

@julio4 julio4 commented Oct 20, 2025

Following #43

Should be enought to close #31 for now, even if it provides "partial" solution

@julio4 julio4 marked this pull request as ready for review October 20, 2025 13:58
@julio4 julio4 force-pushed the feat/multiple-prologue-steps branch from a00a951 to bd5a3fe Compare October 20, 2025 15:21
.prologue()
.get(
step_index
.checked_sub(PROLOGUE_INDEX)
Copy link
Collaborator

Choose a reason for hiding this comment

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

so we remove 0?

Copy link
Collaborator Author

@julio4 julio4 Oct 27, 2025

Choose a reason for hiding this comment

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

This is basically useless as PROLOGUE_INDEX = usize::MIN but it makes the whole logic correct (else we should just remove PROLOGUE_INDEX altogether). It should be optimized away at compilation anyway.

Comment on lines +516 to +517
// breaking in prologue or epilogue directly stop pipeline execution
if self.is_epilogue() || self.is_prologue() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can discuss this as well. When we break within a prologue, should we break out of the pipeline, or just go to pipeline steps? I believe breaking out makes more sense

Copy link
Collaborator

@karim-agha karim-agha left a comment

Choose a reason for hiding this comment

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

How about we reduce complexity here and instead of adding the ability to have multiple epilogue and prologue steps and then worry about all the implications of that, instead we create a new type of step that ships with rblib called say All that combine multiple steps into one?

So what your trying to achieve here would be represented as

pipeline
  .with_step(Step1)
  .with_prologue(All([Step2, Step3]))

Wdyt?

We can then configure the break/continue behavior at this combinatorial step level on a case by case basis.

@karim-agha
Copy link
Collaborator

How about we reduce complexity here and instead of adding the ability to have multiple epilogue and prologue steps and then worry about all the implications of that, instead we create a new type of step that ships with rblib called say All that combine multiple steps into one?

So what your trying to achieve here would be represented as

pipeline
  .with_step(Step1)
  .with_prologue(All([Step2, Step3]))

Wdyt?

We can then configure the break/continue behavior at this combinatorial step level on a case by case basis.

This will leave the current pipeline logic as is and move the behavior into combinators.

We might end up with combinator functions such as:

  • All, run all steps regardless of output
  • UntilBreak, run steps until first Break
  • Any
  • etc

@julio4
Copy link
Collaborator Author

julio4 commented Oct 27, 2025

How about we reduce complexity here and instead of adding the ability to have multiple epilogue and prologue steps and then worry about all the implications of that, instead we create a new type of step that ships with rblib called say All that combine multiple steps into one?
So what your trying to achieve here would be represented as

pipeline
  .with_step(Step1)
  .with_prologue(All([Step2, Step3]))

Wdyt?
We can then configure the break/continue behavior at this combinatorial step level on a case by case basis.

This will leave the current pipeline logic as is and move the behavior into combinators.

We might end up with combinator functions such as:

  • All, run all steps regardless of output
  • UntilBreak, run steps until first Break
  • Any
  • etc

I'm all for encapsulating complexity separately as pipeline is already quite complex.
But I'm just wondering what would be the difference between a pipeline vs a combination of steps (appart to get loop control flow)?

@karim-agha
Copy link
Collaborator

How about we reduce complexity here and instead of adding the ability to have multiple epilogue and prologue steps and then worry about all the implications of that, instead we create a new type of step that ships with rblib called say All that combine multiple steps into one?

So what your trying to achieve here would be represented as

pipeline

.with_step(Step1)

.with_prologue(All([Step2, Step3]))

Wdyt?

We can then configure the break/continue behavior at this combinatorial step level on a case by case basis.

This will leave the current pipeline logic as is and move the behavior into combinators.

We might end up with combinator functions such as:

  • All, run all steps regardless of output
  • UntilBreak, run steps until first Break
  • Any
  • etc

I'm all for encapsulating complexity separately as pipeline is already quite complex.

But I'm just wondering what would be the difference between a pipeline vs a combination of steps (appart to get loop control flow)?

A pipeline may include nested pipelines with loops. A combinator step ensures that you have a flat list of steps that will eventually terminate.

Another combinator step I can think of is Atomic. That takes a list of steps and either all succeed or the payload is reverted to its initial state.

@julio4
Copy link
Collaborator Author

julio4 commented Nov 4, 2025

A pipeline may include nested pipelines with loops. A combinator step ensures that you have a flat list of steps that will eventually terminate.

Another combinator step I can think of is Atomic. That takes a list of steps and either all succeed or the payload is reverted to its initial state.

To follow up on this. Should we close this PR and revert implementation for epilogue for consistency?
Or merge this and revert both prologue/epilogue when we have a combinator step

@akundaz
Copy link
Collaborator

akundaz commented Nov 4, 2025

To follow up on this. Should we close this PR and revert implementation for epilogue for consistency? Or merge this and revert both prologue/epilogue when we have a combinator step

I would prefer we get something merged for now (and also not revert the epilogue change) since flashtestations requires the additional prologue and flashblocks requires the additional epilogue

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.

Support nested Pipeline in prologue and epilogue

4 participants