Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature change observer pattern #271

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

Wikunia
Copy link
Owner

@Wikunia Wikunia commented Aug 1, 2021

Closes #269

Function notify_constraints_var_changed! calls changed_var! for the constraints that are affected.
Currently only the linear constraint implements the function to compute new mins and maxs values.

@codecov
Copy link

codecov bot commented Aug 1, 2021

Codecov Report

Merging #271 (a1057f1) into master (68fd0b1) will decrease coverage by 0.01%.
The diff coverage is 97.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #271      +/-   ##
==========================================
- Coverage   97.62%   97.61%   -0.02%     
==========================================
  Files          52       52              
  Lines        4344     4450     +106     
==========================================
+ Hits         4241     4344     +103     
- Misses        103      106       +3     
Impacted Files Coverage Δ
src/pruning.jl 100.00% <ø> (ø)
src/types.jl 99.00% <ø> (ø)
src/constraints/activator_constraints.jl 89.36% <55.55%> (-10.64%) ⬇️
src/ConstraintSolver.jl 98.35% <94.11%> (-0.24%) ⬇️
src/Variable.jl 100.00% <100.00%> (ø)
src/constraints.jl 100.00% <100.00%> (ø)
src/constraints/all_different.jl 100.00% <100.00%> (ø)
src/constraints/all_equal.jl 94.94% <100.00%> (ø)
src/constraints/and.jl 100.00% <100.00%> (ø)
src/constraints/boolset.jl 100.00% <100.00%> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 68fd0b1...a1057f1. Read the comment docs.

@Wikunia
Copy link
Owner Author

Wikunia commented Aug 1, 2021

Benchmark Report for ConstraintSolver

Job Properties

  • Time of benchmarks:
    • Target: 11 Sep 2021 - 13:29
    • Baseline: 11 Sep 2021 - 13:43
  • Package commits:
    • Target: 82b89f
    • Baseline: 2d857b
  • Julia commits:
    • Target: 6aaede
    • Baseline: 6aaede
  • Julia command flags:
    • Target: -O3
    • Baseline: -O3
  • Environment variables:
    • Target: None
    • Baseline: None

Results

A ratio greater than 1.0 denotes a possible regression (marked with ❌), while a ratio less
than 1.0 denotes a possible improvement (marked with ✅). Only significant results - results
that indicate possible regressions or improvements - are shown below (thus, an empty table means that all
benchmark results remained invariant between builds).

ID time ratio memory ratio
["eternity", "5x5_all"] 1.12 (5%) ❌ 1.06 (1%) ❌
["eternity", "5x5_opt"] 1.09 (5%) ❌ 1.03 (1%) ❌
["eternity", "5x5_opt_ind"] 1.12 (5%) ❌ 1.04 (1%) ❌
["eternity", "5x5_opt_rei"] 1.08 (5%) ❌ 1.04 (1%) ❌
["eternity", "6x5"] 1.06 (5%) ❌ 1.06 (1%) ❌
["eternity", "6x5_ABS"] 1.05 (5%) ❌ 1.06 (1%) ❌
["graph_coloring", "US_50colors"] 1.27 (5%) ❌ 1.15 (1%) ❌
["graph_coloring", "US_50colors+equal"] 1.23 (5%) ❌ 1.16 (1%) ❌
["graph_coloring", "US_50colors+equal_ABS"] 1.35 (5%) ❌ 1.18 (1%) ❌
["graph_coloring", "US_8+equal"] 1.09 (5%) ❌ 1.06 (1%) ❌
["graph_coloring", "US_8+equal_ABS"] 1.12 (5%) ❌ 1.05 (1%) ❌
["graph_coloring", "le450_5d"] 1.31 (5%) ❌ 1.36 (1%) ❌
["graph_coloring", "queen7_7"] 1.18 (5%) ❌ 1.14 (1%) ❌
["killer_sudoku", "niall_5500"] 0.48 (5%) ✅ 0.54 (1%) ✅
["killer_sudoku", "niall_5500_ABS"] 12.26 (5%) ❌ 12.45 (1%) ❌
["killer_sudoku", "niall_5500_special"] 0.67 (5%) ✅ 0.72 (1%) ✅
["killer_sudoku", "niall_5501"] 0.66 (5%) ✅ 0.69 (1%) ✅
["killer_sudoku", "niall_5501_ABS"] 0.05 (5%) ✅ 0.06 (1%) ✅
["killer_sudoku", "niall_5501_special"] 2.12 (5%) ❌ 2.21 (1%) ❌
["lp", "issue_83"] 0.94 (5%) ✅ 1.01 (1%)
["scheduling", "all_different_except_0_len10"] 1.42 (5%) ❌ 1.32 (1%) ❌
["scheduling", "all_different_except_0_len12"] 1.36 (5%) ❌ 1.31 (1%) ❌
["scheduling", "furniture_moving"] 2.74 (5%) ❌ 2.43 (1%) ❌
["scheduling", "organize_day"] 1.43 (5%) ❌ 1.62 (1%) ❌
["steiner", "steiner_7"] 493.77 (5%) ❌ 304.29 (1%) ❌
["sudoku", "25x25_89"] 1.01 (5%) 1.02 (1%) ❌
["sudoku", "25x25_90"] 1.00 (5%) 1.02 (1%) ❌
["sudoku", "top95_1"] 1.05 (5%) 1.06 (1%) ❌
["sudoku", "top95_11"] 0.99 (5%) 1.04 (1%) ❌
["sudoku", "top95_16"] 1.02 (5%) 1.04 (1%) ❌
["sudoku", "top95_21"] 1.01 (5%) 1.06 (1%) ❌
["sudoku", "top95_26"] 0.93 (5%) ✅ 1.06 (1%) ❌
["sudoku", "top95_31"] 1.01 (5%) 1.05 (1%) ❌
["sudoku", "top95_36"] 1.04 (5%) 1.06 (1%) ❌
["sudoku", "top95_41"] 1.04 (5%) 1.05 (1%) ❌
["sudoku", "top95_46"] 1.03 (5%) 1.05 (1%) ❌
["sudoku", "top95_51"] 0.95 (5%) 1.05 (1%) ❌
["sudoku", "top95_56"] 1.03 (5%) 1.04 (1%) ❌
["sudoku", "top95_6"] 1.02 (5%) 1.06 (1%) ❌
["sudoku", "top95_61"] 0.96 (5%) 1.05 (1%) ❌
["sudoku", "top95_66"] 0.98 (5%) 1.04 (1%) ❌
["sudoku", "top95_71"] 1.04 (5%) 1.05 (1%) ❌
["sudoku", "top95_76"] 0.98 (5%) 1.05 (1%) ❌
["sudoku", "top95_81"] 0.99 (5%) 1.05 (1%) ❌
["sudoku", "top95_86"] 1.01 (5%) 1.05 (1%) ❌
["sudoku", "top95_91"] 1.00 (5%) 1.05 (1%) ❌

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["eternity"]
  • ["graph_coloring"]
  • ["killer_sudoku"]
  • ["lp"]
  • ["scheduling"]
  • ["steiner"]
  • ["sudoku"]

Julia versioninfo

Target

Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  uname: Linux 5.13.12-arch1-1 #1 SMP PREEMPT Wed, 18 Aug 2021 20:49:03 +0000 x86_64 unknown
  CPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics: 
                 speed         user         nice          sys         idle          irq
       #1-16  1700 MHz    1775772 s       6259 s     840826 s    2557498 s          0 s
       
  Memory: 38.41743850708008 GB (1495.8359375 MB free)
  Uptime: 969387.0 sec
  Load Avg:  4.03  3.62  3.33
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, znver2)

Baseline

Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  uname: Linux 5.13.12-arch1-1 #1 SMP PREEMPT Wed, 18 Aug 2021 20:49:03 +0000 x86_64 unknown
  CPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics: 
                 speed         user         nice          sys         idle          irq
       #1-16  2029 MHz    1787664 s       6259 s     845095 s    2675998 s          0 s
       
  Memory: 38.41743850708008 GB (1143.59375 MB free)
  Uptime: 970233.0 sec
  Load Avg:  1.71  2.41  2.88
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, znver2)

@Wikunia
Copy link
Owner Author

Wikunia commented Aug 1, 2021

Todo: Compare steiner to before. Probably the change to reverse the complement constraint made this slow.
Those reverses should only happen if the constraint was called.

@Wikunia
Copy link
Owner Author

Wikunia commented Aug 21, 2021

Idea: For prune_constraint and still_feasible have a function in between which checks if it's the first node call (which is an attribute of Constraint) if that's the case then it calls a new function first_node_call which defaults to doing nothing. Then sets the attribute to false.

linear_constraints will be the only constraint so far to implement first_node_call which will recompute the extrema

@Wikunia
Copy link
Owner Author

Wikunia commented Sep 11, 2021

Okay we're back to steiner being very slow but hopefully the bug is fixed 😄

@Wikunia
Copy link
Owner Author

Wikunia commented Jan 8, 2022

Run benchmark tests again to be sure and investigate steiner again...

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.

observer pattern for variable change
1 participant