Browse Source

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.
module-begin
Tony Garnock-Jones 4 years ago
parent
commit
1fa5167e20
  1. 14
      racket/syndicate/actor.rkt
  2. 6
      racket/syndicate/examples/actor/example-synthetic-patch-2.rkt

14
racket/syndicate/actor.rkt

@ -1171,8 +1171,18 @@
(with-current-facet fid #f
(define ep (hash-ref (facet-endpoints f) eid))
(define new-patch ((endpoint-patch-fn ep)))
(update-stream! eid (compose-patch new-patch
(core:retract ?))))))))
(define a (current-actor-state))
(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 a (current-actor-state))

6
racket/syndicate/examples/actor/example-synthetic-patch-2.rkt

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

Loading…
Cancel
Save