Skip to content

Add weak dependencies to TD3#1743

Closed
heigotornik wants to merge 8 commits intogoblint:masterfrom
heigotornik:weak-dependencies
Closed

Add weak dependencies to TD3#1743
heigotornik wants to merge 8 commits intogoblint:masterfrom
heigotornik:weak-dependencies

Conversation

@heigotornik
Copy link
Copy Markdown
Contributor

@heigotornik heigotornik commented May 8, 2025

Added a new function to the right-hand side of an unknown - demand.

The new constraint system functional form definition is val system : v -> ((v -> d) -> (v -> d -> unit) -> (v -> unit) -> d) m, where the added (v -> unit) represents demand.
Thread spawning now uses demandl (Function fd, c); inplace of ignore (getl (Function fd, c)).

TD3 implements demand as demand_thr and adds a new hashmap weak_dep.
TD3 with weak dependencies can be run in two "modes" - eager and lazy.

Eager.
Can be toggled with --enable solvers.td3.wk_deps.eager

  1. If demand is called the demanded unknown y is added to the hashmap weak_dep and solved immediately.
  2. If at the end of the iteration any unknown in weak_dep or in vs is unstable, they are solved again until all unknowns in both are stable.

Lazy:
Default behavior currently.
Same as eager, but without solving immediately when calling demand.

Part of the bachelor's thesis "Weak Dependencies for Side-Effecting Constraint Systems".

@michael-schwarz
Copy link
Copy Markdown
Member

Thanks for opening the PR! can you please provide a summary of the proposed changes in the description above?

@sim642 sim642 added feature performance Analysis time, memory usage labels May 9, 2025
@sim642 sim642 self-requested a review May 9, 2025 05:47
@michael-schwarz michael-schwarz requested a review from arkocal May 9, 2025 08:08
@michael-schwarz
Copy link
Copy Markdown
Member

@arkocal: How does this interact with your create nodes? If it's a longer discussion, we can maybe have it at Gobcon on Tuesday?

@arkocal
Copy link
Copy Markdown
Contributor

arkocal commented May 9, 2025

This is sufficiently similar to Felix implementation of create nodes, that it is most likely more reasonable to not keep both. (it would unnecessarily complicate the constraint systems). I believe it would be possible to use this or that going forward.

One major difference, which would maybe also be nice to have here, is that the unaffected solvers can be lifted to be ignorant to this change.

I think it makes sense to discuss the exact semantics of both to make sure this is the case. After that it becomes a question of timing when to merge.

@sim642
Copy link
Copy Markdown
Member

sim642 commented May 19, 2025

I will take care of the merge conflicts once #1746 is merged.

@michael-schwarz
Copy link
Copy Markdown
Member

I guess with #1747 open, this can now be closed?

@sim642 sim642 closed this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature performance Analysis time, memory usage student-job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants