[cells-devel] Major Cells fix (?)

Kenny Tilton ktilton at nyc.rr.com
Fri May 14 08:01:08 UTC 2004


I decided to address something about Cells I recently decided was Not Good:

The echo of a cell (something conceived to permit side-effects outside 
the model dataflow) is permitted to kick off top-level (if you will) 
dataflow by setting some c-variable-mediated other slot.

Fine. But echos run immediately after a new value has been assumed by a 
cell, before propagation to other cells. So what we had was 
echo-initiated top-level dataflow running to completion before the 
dataflow being echoed really got very far off the ground. And, yes, some 
very tricky misbehavior resulted, and I think is responsible for a lot 
of nasty code in Cells.

Anyway, tonight I hacked a quick single-threading of such things:

(defun (setf md-slot-value) .....<snip>

      ...unchanged testing for cyclicity....

      (let ((absorbed-value (c-absorb-value c new-value)))
        ;; dicey: decide absorbed-value now or just before setf?
        ;; ...but we need a value to return even if actual setf will be 
deferred.
        ;;
        (count-it :md-slot-value-setf slot-spec)
        (if *df-entry*
            (progn
              (nconc *df-entry* (list (cons c (cons absorbed-value 
*cause*))))
              absorbed-value)
          (let ((*df-entry* (list nil)))
            (c-slot-value-absorb c absorbed-value)
            (loop for (c-deferred . (deferred-value . echoing-asker)) in 
(cdr *df-entry*)
                do (let ((*cause* echoing-asker)) ;; sketchy
                        (c-slot-value-absorb c-deferred deferred-value)))
            absorbed-value))))))

(defun c-slot-value-absorb (c absorbed-value)
    (with-dataflow-management (c)
      (md-slot-value-assume (c-model c) (c-slot-spec c) absorbed-value)))


"absorb"? "assume"? gotta work on that. The light panel still works, but 
tracing shows not a lot of very challenging cases. RoboCup was the worst 
stress test Cells has gotten, stumping it easily even after seven years 
of refinement. I may dust off TeamKenny to see what I can see. I prefer 
real-world stressors to artifices.

Actually, what I should do is disable all the "m/cmdead" testing, which 
I believe arose to handle problems caused only by overlapping dataflow 
steps: some echo would cause some instance (the active player task) to 
leave the model (supplanted or completed), but already in the call stack 
was code that was going to be operating on those instances in some way 
shape or form. So in a mad dash before ILC 2003 I ended up sprinkling 
"dead" tests about thirty times around the system. My hope is that this 
new patch will clear the dataflow propagation stack before the echo zaps 
the instance.

More to come, I guess.

kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 
Your Project Here! http://alu.cliki.net/Industry%20Application






More information about the cells-devel mailing list