Skip to content

saving EntanglementConsumer logs#377

Open
JoseRodriguezRomero wants to merge 16 commits intoQuantumSavory:masterfrom
JoseRodriguezRomero:jose/consumer_logs_save
Open

saving EntanglementConsumer logs#377
JoseRodriguezRomero wants to merge 16 commits intoQuantumSavory:masterfrom
JoseRodriguezRomero:jose/consumer_logs_save

Conversation

@JoseRodriguezRomero
Copy link
Copy Markdown

Support for saving and loading log files of an EntanglementConsumer protocol instance. The logs can be saved in .txt, .csv and .h5 formats. The saved data will consist of the two observables recorded by the EntanglementConsumer and the time of each event. Moreover, for .h5 formatted files, an optional parameter has been added to

@resumable function (prot::EntanglementConsumer)(metadata::Dict{String,Any} = Dict{String,Any}())

to store any metadata a user may want to save (if the selected file format is .txt or .csv the metadata is not saved).

@JoseRodriguezRomero JoseRodriguezRomero marked this pull request as draft April 6, 2026 18:59
@JoseRodriguezRomero JoseRodriguezRomero marked this pull request as ready for review April 6, 2026 19:00
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

Benchmark Results (Julia v1)

Time benchmarks
master a1c140e... master / a1c140e...
onchange/dual_messagebuffer_any/writers_2_waiters_1 1.2 ± 0.028 ms 1.16 ± 0.025 ms 1.04 ± 0.033
onchange/dual_messagebuffer_any/writers_4_waiters_1 2.33 ± 0.055 ms 2.27 ± 0.051 ms 1.03 ± 0.033
onchange/dual_messagebuffer_any/writers_4_waiters_4 2.69 ± 0.07 ms 2.64 ± 0.07 ms 1.02 ± 0.038
onchange/dual_messagebuffer_any/writers_8_waiters_4 5.59 ± 0.28 ms 5.34 ± 0.22 ms 1.05 ± 0.067
onchange/sharded_registers/pairs_1 0.482 ± 0.065 ms 0.464 ± 0.063 ms 1.04 ± 0.2
onchange/sharded_registers/pairs_16 7.93 ± 0.17 ms 7.54 ± 0.15 ms 1.05 ± 0.031
onchange/sharded_registers/pairs_32 16.4 ± 0.3 ms 15.5 ± 0.31 ms 1.06 ± 0.029
onchange/sharded_registers/pairs_4 1.87 ± 0.041 ms 1.82 ± 0.039 ms 1.02 ± 0.031
onchange/shared_messagebuffer_channel/writers_1_waiters_1 0.9 ± 0.023 ms 0.829 ± 0.02 ms 1.08 ± 0.038
onchange/shared_messagebuffer_channel/writers_1_waiters_8 0.77 ± 0.022 ms 0.72 ± 0.022 ms 1.07 ± 0.045
onchange/shared_messagebuffer_channel/writers_4_waiters_4 3 ± 0.31 ms 2.71 ± 0.31 ms 1.1 ± 0.17
onchange/shared_messagebuffer_channel/writers_8_waiters_1 7.09 ± 0.63 ms 6.45 ± 0.61 ms 1.1 ± 0.14
onchange/shared_messagebuffer_direct/writers_16_waiters_2 4.51 ± 0.67 ms 4.41 ± 0.7 ms 1.02 ± 0.22
onchange/shared_messagebuffer_direct/writers_1_waiters_1 0.311 ± 0.042 ms 0.308 ± 0.042 ms 1.01 ± 0.2
onchange/shared_messagebuffer_direct/writers_1_waiters_8 0.365 ± 0.056 ms 0.363 ± 0.054 ms 1.01 ± 0.22
onchange/shared_messagebuffer_direct/writers_2_waiters_16 0.881 ± 0.15 ms 0.862 ± 0.15 ms 1.02 ± 0.26
onchange/shared_messagebuffer_direct/writers_4_waiters_4 1.19 ± 0.17 ms 1.16 ± 0.17 ms 1.02 ± 0.21
onchange/shared_messagebuffer_direct/writers_8_waiters_1 2.24 ± 0.3 ms 2.21 ± 0.3 ms 1.01 ± 0.19
onchange/shared_register/writers_16_waiters_2 7.6 ± 1.3 ms 7.42 ± 1.3 ms 1.02 ± 0.24
onchange/shared_register/writers_1_waiters_1 0.478 ± 0.066 ms 0.47 ± 0.065 ms 1.02 ± 0.2
onchange/shared_register/writers_1_waiters_8 0.599 ± 0.087 ms 0.585 ± 0.087 ms 1.02 ± 0.21
onchange/shared_register/writers_2_waiters_16 1.56 ± 0.15 ms 1.52 ± 0.22 ms 1.02 ± 0.18
onchange/shared_register/writers_4_waiters_4 2 ± 0.31 ms 1.94 ± 0.32 ms 1.03 ± 0.24
onchange/shared_register/writers_8_waiters_1 3.71 ± 0.53 ms 3.7 ± 0.5 ms 1 ± 0.2
onchange/shared_regref/writers_1_waiters_1 0.484 ± 0.066 ms 0.458 ± 0.069 ms 1.06 ± 0.21
onchange/shared_regref/writers_1_waiters_8 0.601 ± 0.092 ms 0.578 ± 0.089 ms 1.04 ± 0.23
onchange/shared_regref/writers_4_waiters_4 2.03 ± 0.32 ms 1.93 ± 0.34 ms 1.05 ± 0.25
onchange/shared_regref/writers_8_waiters_1 3.74 ± 0.56 ms 3.65 ± 0.56 ms 1.03 ± 0.22
quantumstates/observable/quantumoptics 0.912 ± 0.25 μs 0.842 ± 0.22 μs 1.08 ± 0.41
querywait/messagebuffer_channel/writers_1_waiters_1 1.02 ± 0.029 ms 1.04 ± 0.025 ms 0.974 ± 0.036
querywait/messagebuffer_channel/writers_1_waiters_8 2.24 ± 0.092 ms 2.3 ± 0.072 ms 0.974 ± 0.05
querywait/messagebuffer_channel/writers_4_waiters_4 6.52 ± 0.59 ms 6.8 ± 0.61 ms 0.959 ± 0.12
querywait/messagebuffer_channel/writers_8_waiters_1 8.04 ± 0.63 ms 8.23 ± 0.67 ms 0.977 ± 0.11
querywait/messagebuffer_direct/writers_1_waiters_1 0.377 ± 0.047 ms 0.449 ± 0.051 ms 0.839 ± 0.14
querywait/messagebuffer_direct/writers_1_waiters_8 1.5 ± 0.21 ms 1.63 ± 0.21 ms 0.919 ± 0.17
querywait/messagebuffer_direct/writers_4_waiters_4 3.58 ± 0.48 ms 4.06 ± 0.48 ms 0.883 ± 0.16
querywait/messagebuffer_direct/writers_8_waiters_1 2.76 ± 0.31 ms 3.31 ± 0.37 ms 0.833 ± 0.13
querywait/register_query_wait/writers_1_waiters_1 0.373 ± 0.053 ms 0.45 ± 0.057 ms 0.829 ± 0.16
querywait/register_query_wait/writers_1_waiters_8 1.37 ± 0.21 ms 1.42 ± 0.21 ms 0.961 ± 0.21
querywait/register_query_wait/writers_4_waiters_4 3.27 ± 0.51 ms 3.56 ± 0.51 ms 0.917 ± 0.19
querywait/register_query_wait/writers_8_waiters_1 2.72 ± 0.4 ms 3.46 ± 0.45 ms 0.787 ± 0.15
querywait/register_querydelete_wait/writers_1_waiters_1 0.358 ± 0.05 ms 0.422 ± 0.054 ms 0.848 ± 0.16
querywait/register_querydelete_wait/writers_1_waiters_8 1.35 ± 0.21 ms 1.39 ± 0.21 ms 0.968 ± 0.21
querywait/register_querydelete_wait/writers_4_waiters_4 3.2 ± 0.51 ms 3.43 ± 0.51 ms 0.933 ± 0.2
querywait/register_querydelete_wait/writers_8_waiters_1 2.61 ± 0.36 ms 3.17 ± 0.43 ms 0.823 ± 0.16
register/creation_and_initialization/from_tests 0.296 ± 0.027 ms 0.269 ± 0.026 ms 1.1 ± 0.15
semaphore/api/lock_direct 1.24 ± 0.031 μs 1.04 ± 0.04 μs 1.19 ± 0.055
semaphore/api/onchange_register 1.28 ± 0.06 μs 1.08 ± 0.041 μs 1.19 ± 0.071
semaphore/api/onchange_regref 1.29 ± 0.059 μs 1.1 ± 0.04 μs 1.17 ± 0.069
semaphore/broadcast_direct/waiters_1_rounds_1 28.1 ± 2.1 μs 27.6 ± 2.1 μs 1.02 ± 0.11
semaphore/broadcast_direct/waiters_1_rounds_4 0.0693 ± 0.0084 ms 0.0671 ± 0.0079 ms 1.03 ± 0.17
semaphore/broadcast_direct/waiters_256_rounds_1 0.0582 ± 0.0064 s 0.0581 ± 0.0068 s 1 ± 0.16
semaphore/broadcast_direct/waiters_64_rounds_1 3.86 ± 0.089 ms 3.85 ± 0.11 ms 1 ± 0.037
semaphore/broadcast_direct/waiters_64_rounds_4 15.7 ± 0.39 ms 15.7 ± 0.48 ms 1 ± 0.039
semaphore/broadcast_direct/waiters_8_rounds_1 0.166 ± 0.028 ms 0.165 ± 0.027 ms 1.01 ± 0.24
semaphore/broadcast_direct/waiters_8_rounds_4 0.561 ± 0.047 ms 0.545 ± 0.057 ms 1.03 ± 0.14
semaphore/broadcast_register/waiters_1_rounds_1 31.3 ± 3.8 μs 30.5 ± 3.3 μs 1.03 ± 0.17
semaphore/broadcast_register/waiters_1_rounds_4 0.0768 ± 0.01 ms 0.0756 ± 0.011 ms 1.02 ± 0.2
semaphore/broadcast_register/waiters_256_rounds_1 0.0583 ± 0.0059 s 0.0586 ± 0.0066 s 0.995 ± 0.15
semaphore/broadcast_register/waiters_64_rounds_1 3.88 ± 0.11 ms 3.86 ± 0.11 ms 1 ± 0.041
semaphore/broadcast_register/waiters_64_rounds_4 15.8 ± 0.37 ms 15.7 ± 0.45 ms 1 ± 0.037
semaphore/broadcast_register/waiters_8_rounds_1 0.165 ± 0.027 ms 0.168 ± 0.028 ms 0.981 ± 0.23
semaphore/broadcast_register/waiters_8_rounds_4 0.563 ± 0.051 ms 0.551 ± 0.085 ms 1.02 ± 0.18
semaphore/broadcast_regref/waiters_1_rounds_1 29.7 ± 2.8 μs 28.3 ± 2.5 μs 1.05 ± 0.13
semaphore/broadcast_regref/waiters_256_rounds_1 0.0614 ± 0.0048 s 0.0611 ± 0.0051 s 1.01 ± 0.11
semaphore/broadcast_regref/waiters_64_rounds_1 3.87 ± 0.091 ms 3.81 ± 0.098 ms 1.02 ± 0.035
semaphore/broadcast_regref/waiters_8_rounds_1 0.15 ± 0.023 ms 0.146 ± 0.023 ms 1.03 ± 0.22
tagquery/messagebuffer/query 0.851 ± 0.019 μs 0.932 ± 0.011 μs 0.913 ± 0.023
tagquery/messagebuffer/query_high_arity 0.531 ± 0.01 μs 0.892 ± 0.011 μs 0.595 ± 0.013
tagquery/messagebuffer/query_high_arity_predicate 9.13 ± 0.77 μs 9.59 ± 0.78 μs 0.952 ± 0.11
tagquery/messagebuffer/query_miss 0.13 ± 0.001 μs 0.13 ± 0 μs 1 ± 0.0077
tagquery/messagebuffer/query_tag_dispatch 1.45 ± 0.01 μs 1.91 ± 0.011 μs 0.759 ± 0.0068
tagquery/messagebuffer/querydelete 0.381 ± 0.05 μs 0.401 ± 0.072 μs 0.95 ± 0.21
tagquery/messagebuffer/querydelete_back 0.461 ± 0.11 μs 0.552 ± 0.13 μs 0.835 ± 0.28
tagquery/messagebuffer/querydelete_front 0.231 ± 0.03 μs 0.21 ± 0.05 μs 1.1 ± 0.3
tagquery/messagebuffer/querydelete_miss 0.41 ± 0.06 μs 0.5 ± 0.13 μs 0.82 ± 0.24
tagquery/misc/from_tests 9.48 ± 3.4 μs 9.61 ± 3.5 μs 0.986 ± 0.51
tagquery/register/query 3.37 ± 0.027 s 3.23 ± 0.015 s 1.04 ± 0.0098
tagquery/register/query_assigned 0.951 ± 0.01 μs 0.932 ± 0.01 μs 1.02 ± 0.015
tagquery/register/query_exact_fifo 0.5 ± 0.01 μs 0.661 ± 0.02 μs 0.756 ± 0.027
tagquery/register/query_exact_filo 2.5 ± 0.02 μs 2.3 ± 0.08 μs 1.08 ± 0.039
tagquery/register/query_locked 0.581 ± 0.01 μs 0.461 ± 0.01 μs 1.26 ± 0.035
tagquery/register/query_miss 2 ± 0.02 μs 1.99 ± 0.02 μs 1.01 ± 0.014
tagquery/register/query_predicate 1.7 ± 0.021 μs 1.62 ± 0.029 μs 1.05 ± 0.023
tagquery/register/query_tag_dispatch 2.11 ± 0.02 μs 2.02 ± 0.03 μs 1.04 ± 0.018
tagquery/register/query_unassigned 1.38 ± 0.01 μs 1.37 ± 0.01 μs 1.01 ± 0.01
tagquery/register/queryall 3.53 ± 0.0071 s 3.36 ± 0.0047 s 1.05 ± 0.0026
tagquery/register/queryall_fifo 2.68 ± 0.23 μs 2.73 ± 0.23 μs 0.982 ± 0.12
tagquery/register/queryall_filo 2.71 ± 0.23 μs 2.73 ± 0.24 μs 0.996 ± 0.12
tagquery/register/queryall_tag_dispatch 2.1 ± 0.08 μs 2.11 ± 0.06 μs 0.991 ± 0.047
tagquery/register_high_arity/query_exact 0.29 ± 0.01 μs 0.311 ± 0.01 μs 0.932 ± 0.044
tagquery/register_high_arity/query_predicate 1.77 ± 0.021 μs 1.67 ± 0.021 μs 1.06 ± 0.018
tagquery/register_high_arity/queryall 0.321 ± 0.021 μs 0.331 ± 0.011 μs 0.97 ± 0.071
tagquery/register_mutating/querydelete_register 2.12 ± 0.18 μs 1.58 ± 0.16 μs 1.34 ± 0.18
tagquery/register_mutating/querydelete_regref_fifo 0.942 ± 0.099 μs 1.13 ± 0.13 μs 0.831 ± 0.13
tagquery/register_mutating/querydelete_regref_filo 1.94 ± 0.14 μs 1 ± 0.11 μs 1.94 ± 0.25
tagquery/register_mutating/untag_by_id 0.16 ± 0.029 μs 0.13 ± 0.021 μs 1.23 ± 0.3
tagquery/register_ref/query_fifo 0.501 ± 0.018 μs 0.561 ± 0.01 μs 0.893 ± 0.036
tagquery/register_ref/query_filo 0.952 ± 0.02 μs 0.561 ± 0.011 μs 1.7 ± 0.049
tagquery/register_ref/query_tag_dispatch 0.321 ± 0.011 μs 0.321 ± 0.001 μs 1 ± 0.034
tagquery/register_ref/queryall_fifo 0.982 ± 0.03 μs 0.831 ± 0.061 μs 1.18 ± 0.094
tagquery/register_ref/queryall_filo 0.681 ± 0.041 μs 0.681 ± 0.051 μs 1 ± 0.096
time_to_load 15.2 ± 0.1 s 14.9 ± 0.08 s 1.02 ± 0.0089
Memory benchmarks
master a1c140e... master / a1c140e...
onchange/dual_messagebuffer_any/writers_2_waiters_1 10 k allocs: 0.485 MB 10 k allocs: 0.485 MB 1
onchange/dual_messagebuffer_any/writers_4_waiters_1 19.9 k allocs: 0.96 MB 19.9 k allocs: 0.96 MB 1
onchange/dual_messagebuffer_any/writers_4_waiters_4 25.2 k allocs: 1.2 MB 25.2 k allocs: 1.2 MB 1
onchange/dual_messagebuffer_any/writers_8_waiters_4 0.0537 M allocs: 2.45 MB 0.0537 M allocs: 2.45 MB 1
onchange/sharded_registers/pairs_1 4.05 k allocs: 0.199 MB 4.05 k allocs: 0.199 MB 1
onchange/sharded_registers/pairs_16 0.0724 M allocs: 3.35 MB 0.0724 M allocs: 3.35 MB 1
onchange/sharded_registers/pairs_32 0.149 M allocs: 6.76 MB 0.149 M allocs: 6.76 MB 1
onchange/sharded_registers/pairs_4 16.4 k allocs: 0.809 MB 16.4 k allocs: 0.809 MB 1
onchange/shared_messagebuffer_channel/writers_1_waiters_1 4.49 k allocs: 0.215 MB 4.49 k allocs: 0.215 MB 1
onchange/shared_messagebuffer_channel/writers_1_waiters_8 5.33 k allocs: 0.253 MB 5.33 k allocs: 0.253 MB 1
onchange/shared_messagebuffer_channel/writers_4_waiters_4 19.1 k allocs: 0.905 MB 19.1 k allocs: 0.905 MB 1
onchange/shared_messagebuffer_channel/writers_8_waiters_1 0.0373 M allocs: 1.7 MB 0.0373 M allocs: 1.7 MB 1
onchange/shared_messagebuffer_direct/writers_16_waiters_2 0.0427 M allocs: 1.89 MB 0.0427 M allocs: 1.89 MB 1
onchange/shared_messagebuffer_direct/writers_1_waiters_1 2.36 k allocs: 0.112 MB 2.36 k allocs: 0.112 MB 1
onchange/shared_messagebuffer_direct/writers_1_waiters_8 3.2 k allocs: 0.152 MB 3.2 k allocs: 0.152 MB 1
onchange/shared_messagebuffer_direct/writers_2_waiters_16 8.24 k allocs: 0.444 MB 8.24 k allocs: 0.444 MB 1
onchange/shared_messagebuffer_direct/writers_4_waiters_4 10.8 k allocs: 0.504 MB 10.8 k allocs: 0.504 MB 1
onchange/shared_messagebuffer_direct/writers_8_waiters_1 18.7 k allocs: 0.874 MB 18.7 k allocs: 0.874 MB 1
onchange/shared_register/writers_16_waiters_2 0.0747 M allocs: 3.43 MB 0.0747 M allocs: 3.43 MB 1
onchange/shared_register/writers_1_waiters_1 4.05 k allocs: 0.199 MB 4.05 k allocs: 0.199 MB 1
onchange/shared_register/writers_1_waiters_8 5.7 k allocs: 0.275 MB 5.7 k allocs: 0.275 MB 0.997
onchange/shared_register/writers_2_waiters_16 15.1 k allocs: 0.861 MB 15.1 k allocs: 0.861 MB 1
onchange/shared_register/writers_4_waiters_4 19 k allocs: 0.919 MB 19 k allocs: 0.919 MB 1
onchange/shared_register/writers_8_waiters_1 0.0333 M allocs: 1.63 MB 0.0333 M allocs: 1.63 MB 1
onchange/shared_regref/writers_1_waiters_1 4.05 k allocs: 0.199 MB 4.05 k allocs: 0.199 MB 1
onchange/shared_regref/writers_1_waiters_8 5.7 k allocs: 0.275 MB 5.7 k allocs: 0.275 MB 1
onchange/shared_regref/writers_4_waiters_4 19 k allocs: 0.919 MB 19 k allocs: 0.919 MB 1
onchange/shared_regref/writers_8_waiters_1 0.0333 M allocs: 1.63 MB 0.0333 M allocs: 1.63 MB 1
quantumstates/observable/quantumoptics 22 allocs: 2.44 kB 22 allocs: 2.44 kB 1
querywait/messagebuffer_channel/writers_1_waiters_1 4.92 k allocs: 0.231 MB 4.92 k allocs: 0.231 MB 1
querywait/messagebuffer_channel/writers_1_waiters_8 15.6 k allocs: 0.734 MB 15.6 k allocs: 0.734 MB 1
querywait/messagebuffer_channel/writers_4_waiters_4 0.0419 M allocs: 1.89 MB 0.0419 M allocs: 1.89 MB 1
querywait/messagebuffer_channel/writers_8_waiters_1 0.0418 M allocs: 1.85 MB 0.0418 M allocs: 1.85 MB 1
querywait/messagebuffer_direct/writers_1_waiters_1 2.79 k allocs: 0.128 MB 2.79 k allocs: 0.128 MB 1
querywait/messagebuffer_direct/writers_1_waiters_8 13.4 k allocs: 0.633 MB 13.4 k allocs: 0.633 MB 1
querywait/messagebuffer_direct/writers_4_waiters_4 0.0324 M allocs: 1.47 MB 0.0324 M allocs: 1.47 MB 1
querywait/messagebuffer_direct/writers_8_waiters_1 22.8 k allocs: 1.02 MB 22.8 k allocs: 1.02 MB 1
querywait/register_query_wait/writers_1_waiters_1 2.56 k allocs: 0.137 MB 2.56 k allocs: 0.137 MB 1
querywait/register_query_wait/writers_1_waiters_8 12.1 k allocs: 0.607 MB 12.1 k allocs: 0.607 MB 1
querywait/register_query_wait/writers_4_waiters_4 27.8 k allocs: 1.42 MB 27.8 k allocs: 1.42 MB 1
querywait/register_query_wait/writers_8_waiters_1 20.4 k allocs: 1.09 MB 20.4 k allocs: 1.09 MB 1
querywait/register_querydelete_wait/writers_1_waiters_1 2.5 k allocs: 0.131 MB 2.5 k allocs: 0.131 MB 1
querywait/register_querydelete_wait/writers_1_waiters_8 12 k allocs: 0.602 MB 12 k allocs: 0.602 MB 1
querywait/register_querydelete_wait/writers_4_waiters_4 27.5 k allocs: 1.4 MB 27.5 k allocs: 1.4 MB 1
querywait/register_querydelete_wait/writers_8_waiters_1 19.8 k allocs: 1.04 MB 19.8 k allocs: 1.04 MB 1
register/creation_and_initialization/from_tests 2.67 k allocs: 0.945 MB 2.67 k allocs: 0.945 MB 1
semaphore/api/lock_direct 15 allocs: 0.875 kB 15 allocs: 0.875 kB 1
semaphore/api/onchange_register 15 allocs: 0.875 kB 15 allocs: 0.875 kB 1
semaphore/api/onchange_regref 15 allocs: 0.875 kB 15 allocs: 0.875 kB 1
semaphore/broadcast_direct/waiters_1_rounds_1 0.144 k allocs: 7.58 kB 0.144 k allocs: 7.58 kB 1
semaphore/broadcast_direct/waiters_1_rounds_4 0.521 k allocs: 26.9 kB 0.521 k allocs: 26.9 kB 1
semaphore/broadcast_direct/waiters_256_rounds_1 0.495 M allocs: 0.0331 GB 0.495 M allocs: 0.0331 GB 1
semaphore/broadcast_direct/waiters_64_rounds_1 0.0365 M allocs: 2.36 MB 0.0365 M allocs: 2.36 MB 1
semaphore/broadcast_direct/waiters_64_rounds_4 0.146 M allocs: 9.67 MB 0.146 M allocs: 9.67 MB 1
semaphore/broadcast_direct/waiters_8_rounds_1 1.36 k allocs: 0.0686 MB 1.36 k allocs: 0.0686 MB 1
semaphore/broadcast_direct/waiters_8_rounds_4 5.31 k allocs: 0.261 MB 5.3 k allocs: 0.26 MB 1
semaphore/broadcast_register/waiters_1_rounds_1 0.147 k allocs: 7.7 kB 0.147 k allocs: 7.7 kB 1
semaphore/broadcast_register/waiters_1_rounds_4 0.531 k allocs: 27.4 kB 0.531 k allocs: 27.4 kB 1
semaphore/broadcast_register/waiters_256_rounds_1 0.495 M allocs: 0.0331 GB 0.495 M allocs: 0.0331 GB 1
semaphore/broadcast_register/waiters_64_rounds_1 0.0365 M allocs: 2.36 MB 0.0365 M allocs: 2.36 MB 1
semaphore/broadcast_register/waiters_64_rounds_4 0.146 M allocs: 9.67 MB 0.146 M allocs: 9.67 MB 1
semaphore/broadcast_register/waiters_8_rounds_1 1.36 k allocs: 0.0687 MB 1.36 k allocs: 0.0676 MB 1.02
semaphore/broadcast_register/waiters_8_rounds_4 5.32 k allocs: 0.262 MB 5.32 k allocs: 0.262 MB 1
semaphore/broadcast_regref/waiters_1_rounds_1 0.147 k allocs: 7.7 kB 0.147 k allocs: 7.7 kB 1
semaphore/broadcast_regref/waiters_256_rounds_1 0.495 M allocs: 0.0331 GB 0.495 M allocs: 0.0331 GB 1
semaphore/broadcast_regref/waiters_64_rounds_1 0.0365 M allocs: 2.36 MB 0.0365 M allocs: 2.36 MB 1
semaphore/broadcast_regref/waiters_8_rounds_1 1.36 k allocs: 0.0687 MB 1.36 k allocs: 0.0687 MB 1
tagquery/messagebuffer/query 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/query_high_arity 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/query_high_arity_predicate 0.393 k allocs: 6.22 kB 0.393 k allocs: 6.22 kB 1
tagquery/messagebuffer/query_miss 0 allocs: 0 B 0 allocs: 0 B
tagquery/messagebuffer/query_tag_dispatch 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/messagebuffer/querydelete 1 allocs: 32 B 1 allocs: 32 B 1
tagquery/messagebuffer/querydelete_back 1 allocs: 32 B 1 allocs: 32 B 1
tagquery/messagebuffer/querydelete_front 1 allocs: 32 B 1 allocs: 32 B 1
tagquery/messagebuffer/querydelete_miss 0 allocs: 0 B 0 allocs: 0 B
tagquery/misc/from_tests 0.187 k allocs: 13.1 kB 0.187 k allocs: 13.1 kB 1
tagquery/register/query 4.52 M allocs: 0.573 GB 4.9 M allocs: 0.621 GB 0.922
tagquery/register/query_assigned 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/query_exact_fifo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_exact_filo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_locked 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/query_miss 1 allocs: 0.109 kB 1 allocs: 0.109 kB 1
tagquery/register/query_predicate 14 allocs: 0.578 kB 14 allocs: 0.578 kB 1
tagquery/register/query_tag_dispatch 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register/query_unassigned 3 allocs: 0.281 kB 3 allocs: 0.281 kB 1
tagquery/register/queryall 5.1 M allocs: 1.01 GB 4.71 M allocs: 0.936 GB 1.08
tagquery/register/queryall_fifo 6 allocs: 6.8 kB 6 allocs: 6.8 kB 1
tagquery/register/queryall_filo 6 allocs: 6.8 kB 6 allocs: 6.8 kB 1
tagquery/register/queryall_tag_dispatch 3 allocs: 0.625 kB 3 allocs: 0.625 kB 1
tagquery/register_high_arity/query_exact 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_high_arity/query_predicate 21 allocs: 0.75 kB 21 allocs: 0.75 kB 1
tagquery/register_high_arity/queryall 3 allocs: 0.625 kB 3 allocs: 0.625 kB 1
tagquery/register_mutating/querydelete_register 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/querydelete_regref_fifo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/querydelete_regref_filo 2 allocs: 0.266 kB 2 allocs: 0.266 kB 1
tagquery/register_mutating/untag_by_id 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
tagquery/register_ref/query_fifo 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/query_filo 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/query_tag_dispatch 3 allocs: 0.375 kB 3 allocs: 0.375 kB 1
tagquery/register_ref/queryall_fifo 4 allocs: 0.734 kB 4 allocs: 0.734 kB 1
tagquery/register_ref/queryall_filo 4 allocs: 0.734 kB 4 allocs: 0.734 kB 1
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

Copy link
Copy Markdown
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

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

Thanks for setting this up, it seems to be going in the right direction.

I have a few suggestions that should hopefully make the code simpler, shorter, and more local (not changing so many use locations). You can re-request review when they are done.

Comment thread src/ProtocolZoo/ProtocolZoo.jl Outdated
NetworkNodeController, EndNodeController, LinkController
NetworkNodeController, EndNodeController, LinkController,
# save and load entanglement consumer logs
EntanglementConsumerLog, save_entanglement_consumer_log, load_entanglement_consumer_log
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let's avoid creating new public functions and structs -- they are a significant maintenance burden in the future

per-protocol log structure and saving/loading function also seems like a design that will not scale well when we add similar features to many other protocols

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reverted to how it was before. As of the writing of this comment, the test scripts still need to be reverted back (I will do this tomorrow).

The main issue with the current implementation is that there is no "simple" way to tell when the simulation has finally stopped, or at least I cannot easily see how, without having access to an exported save function to store the log in a file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The test scripts have been reverted back to how they were before.

Comment thread src/ProtocolZoo/consumer.jl Outdated

$FIELDS
"""
@kwdef struct EntanglementConsumerLog
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Introducing this new type seems to have caused the need to change a lot of code in many other unrelated parts of the library. I would like to avoid breaking changes unless they are necessary. Admittedly this is only a "technically breaking", not "formally breaking" change as it is not touching public APIs, but it is easy to avoid it, so let's avoid it.

It also happens to be a change that introduce new formally public API end points -- avoiding that when possible also helps with the review and maintenance burden, so let's do it as well.

Lastly, the previous setup conformed to the Tables.jl AbstractRow API better that makes it more easy to consume from other packages, another reason I would prefer to stick to it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed the new type.

Comment thread Project.toml Outdated
Gabs = "0eb812ee-a11f-4f5e-b8d4-bb8a44f06f50"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
GraphsMatching = "c3af3a8c-b79e-4b01-bf44-c718d7e0e0d6"
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is a pretty significant dependency, let's keep it in a pkg extension

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added extensions for HDF5 and CVS types.

Comment thread src/ProtocolZoo/consumer.jl Outdated
_save_log_hdf5(file_name, log)
elseif endswith(file_name, ".csv")
_save_log_csv(file_name, log)
elseif endswith(file_name, ".txt")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

txt is not a standard format, let's just remove it and keep only well defined standard formats

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

removed saving to .txt format.

Comment thread src/ProtocolZoo/consumer.jl Outdated

function _save_log_csv(file_name::String, log::EntanglementConsumerLog)
open(file_name, "w") do file
println(file, "time,obs1,obs2")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use CSV.jl, do not hand-roll your own solution (put it in a pkg extension)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

added support to saving to CSV as an extension using CSV.jl

Comment thread src/ProtocolZoo/consumer.jl Outdated
return
end

if endswith(file_name, ".h5") || endswith(file_name, ".hdf5")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this type of switch statements (if/else sequences) are usually a sign that multiple dispatch should be used. Check the FileIO for a more central API for these that will be more scallable and extendable, with fewer if-else trees, e.g. see the save block here http://juliaio.github.io/FileIO.jl/stable/implementing/#All-at-once-I/O:-implementing-load-and-save

E.g. if HDF5 and CSV in julia are both built around the FileIO ecosystem (check if this is the case), then the proper solution would be to define a

FileIO.save(::Format{CSV}, ::EntanglementConsumer)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added save functions as suggested.

@Krastanov
Copy link
Copy Markdown
Member

Let's also remove the metadata dict until we have an explicit use for it. It seems like something that might be more appropriate in the save function itself, not in the protocol.

@Krastanov Krastanov changed the title Jose/consumer logs save saving EntanglementConsumer logs Apr 11, 2026
@Krastanov
Copy link
Copy Markdown
Member

I edited the title to not be the branch name -- the titles get auto-listed in release notes so it helps to have them be explanatory

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 56.92308% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.29%. Comparing base (7cd2959) to head (a1c140e).

Files with missing lines Patch % Lines
src/ProtocolZoo/consumer.jl 74.00% 13 Missing ⚠️
ext/QuantumSavoryHDF5/QuantumSavoryHDF5.jl 0.00% 10 Missing ⚠️
ext/QuantumSavoryCSV/QuantumSavoryCSV.jl 0.00% 3 Missing ⚠️
ext/QuantumSavoryFileIO/QuantumSavoryFileIO.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #377      +/-   ##
==========================================
- Coverage   76.79%   76.29%   -0.51%     
==========================================
  Files          53       57       +4     
  Lines        2504     2518      +14     
==========================================
- Hits         1923     1921       -2     
- Misses        581      597      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

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

some naming conventions and using hdf5 idiomatically seem to be the main outstanding issues


import QuantumSavory
using QuantumSavory.ProtocolZoo
import FileIO, CSV, DataFrames
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dataframes is a big dependency, remove it if it can be removed

Comment on lines +10 to +11
write(file, "obs1", [log.obs1 for log in prot._log])
write(file, "obs2", [log.obs2 for log in prot._log])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

need to figure out more standard names than obs1/obs2, so that it can be coordinated with the Sequence team


function FileIO.save(save_file::FileIO.File{FileIO.DataFormat{:CSV},String}, prot::EntanglementConsumer; metadata::Union{Dict{String,Any},Nothing} = nothing)
if !isempty(prot._log)
CSV.write(save_file, DataFrames.DataFrame(prot._log, ["t", "obs1", "obs2"]))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

obs1 and obs2 should be better named

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should be idiomatic about hdf5

  • it seems it has the notion of group and dataset, let's make sure we use those as appropriate
  • it seems to have the notion of an attribute (for metadata) that would be more natural than the adhoc "metadata_keys"

 - ``QuantumSavoryCSV ``no longer requires ``DataFrames`` as a dependency.
  - Both ``QuantumSavoryCSV`` and ``QuantumSavoryHDF5`` use the property names of ``_log`` in ``EntanglementConsumer`` instead of hard coded names.
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