Fix a design flaw in Syndicate-HLL for syndicate/rkt.

If:
 - a field is used in an assertion of interest in facet A
 - and that field changes
 - to a value that causes the assertion of interest to overlap
   with some facet B's assertion of interest
 - and an assertion matching that interest was already known to the actor,
Then:
 - previously, facet A would not be informed of the matching assertion
 - but now, it is informed of the matching assertion.

This more or less only affects "on asserted" endpoints.

The change here should be written up as an erratum to chapter 5 in my
dissertation. Also, syndicate/js needs to be checked for the bug and
probably fixed in an analogous way.
This commit is contained in:
Tony Garnock-Jones 2018-03-27 21:58:57 +13:00
parent 55e1f09484
commit 1fa5167e20
2 changed files with 15 additions and 5 deletions

View File

@ -1171,8 +1171,18 @@
(with-current-facet fid #f (with-current-facet fid #f
(define ep (hash-ref (facet-endpoints f) eid)) (define ep (hash-ref (facet-endpoints f) eid))
(define new-patch ((endpoint-patch-fn ep))) (define new-patch ((endpoint-patch-fn ep)))
(update-stream! eid (compose-patch new-patch (define a (current-actor-state))
(core:retract ?)))))))) (define new-interests
(trie-subtract (patch-added new-patch)
(mux-interests-of (actor-state-mux a) eid)
#:combiner (lambda (v1 v2) trie-empty)))
(define newly-relevant-knowledge
(biased-intersection (actor-state-knowledge a) new-interests))
(update-stream! eid (compose-patch new-patch (core:retract ?)))
(facet-handle-event! fid
(lookup-facet fid)
(patch newly-relevant-knowledge trie-empty)
#t))))))
(define (update-stream! eid patch) (define (update-stream! eid patch)
(define a (current-actor-state)) (define a (current-actor-state))

View File

@ -1,7 +1,7 @@
#lang syndicate #lang syndicate
;; Illustrates a bug where an endpoint whose interest moves with time, ;; Illustrates a (fixed) bug where an endpoint whose interest moves
;; where that interest eventually overlaps with existing interest, ;; with time, where that interest eventually overlaps with existing
;; fails to be notified of an otherwise-known assertion. ;; interest, fails to be notified of an otherwise-known assertion.
;; ;;
;; Symptomatic output: ;; Symptomatic output:
;; ;;