(* Last modified on Mon Feb  8 20:02:41 PST 1993 by johnh *)
(*      modified on Mon Oct 26 16:39:28 PST 1992 by mhb   *)

This is not strictly a to-do list; not everything in the list is
necessarily a good idea.  This is instead a repository of suggestions,
some of which will/may/should get implemented.


(******** POSSIBLY DO THESE ***********)

1.  Document the Zeus user interface (johnh)

5.  Don't do MoveNear with views, just do Trestle.Install. (?)

6.  Get rid of ZeusClass and make View and Algorithm entirely separate.
    Probably a bad idea, since it's convenient to have some operations
    work equally well on Views and Algorithms, without any TYPECASE
    junk. (mhb)

10. Tie Zeus in with network objects, so that the events don't have
    to be generated in the same address space.  Probably not necessary;
    if you want this effect, write your algorithm with network objects,
    or at the receiving end of a pipe, and translate received events
    into ones that Zeus will process. (mhb)

13. Beef up the transcript view to handle feedback, update, and code
    view events.

16. Put Generic := TextureVBT.New() when session is deleted from main
    menu. (mhb)  (I think this is irrelevant now.)

17. Deadlock in Transcript or code view during delete.  LL problem?
    I haven't seen this myself. (sclafani, saxe)

18. Add TracedView and TracedAlg back into a special session called
    "Debugging"? (mhb)

19. Allow default arguments to the event procedures specified in zume
    input.  Allow real argument types.  Allow more complicated printing
    functions (the stuff that goes in [] brackets).  All of this will
    be lots easier if the zume input is pre-parsed, e.g., if the input
    format is changed to be S-expressions. (mjordan, steveg, mhb, meehan)

25. Try installing all views into a single top level window. (mhb)

26. Allow the algorithm to be run in reverse.  Possible ways to achieve
    this: (1) Keep a stack of events (this allows opening a new view
    in mid-execution).  (2) Add pickle and unpickle methods to views,
    keep a history of these pickles, and call unpickle to go backward.
    The default method would invoke GraphVBT's pickle/unpickle methods
    (which don't exist yet, so far as I know). (mhb)

27. Fix anomalies in shape of control panel. (mhb) (What is this?)

35. If you have exactly enough views (N) to fit in the view window
    (and perhaps also if you have more), the window shows N-1 entries
    followed by a blank entry.  However, if you scroll the window, the
    additional entry then appears, contiguous with the previous views.
    Is this a ListVBT bug?  (mjordan)

36. Zeus doesn't remember the session panel settings in snapshots. 
    this may be a feature or a bug. (mhb)
    
37. I'd like to propose that RegisterView (and RegisterView) in the
    ZeusPanel interface both raise some exception if the client tries
    to register a view (algorithm) name under the same session name
    more than once.  
    
    I was mistakenly thinking that the views were associated with the
    *algorithms* rather than the session, and so I was registering a
    view named "Tree" twice (once for each of my tree algorithms) under
    the same session name.  It took me a while to figure out why one
    of the views seemed to be ignoring a whole class of events.  I
    finally figured out that ZeusPanel was silently ignoring the second
    registration.
    
    On this point, it would seem impossible to provide views for some
    algorithms in a session but not for others.  It would be nice if
    the interface provided a way to associate views with algorithms
    as well as with entire sessions.  (heydon; last point mjordan also)

39. Would it be possible to eliminate the need to register the data 
    view, in the same way that code views are not explicitly
    registered? (mhb)

41. Zeus's snapshot feature doesn't work correctly.  It brings up the
    hatched window in the right place but then places them always in
    the first quadrant, regardless.  (I haven't seen this.)  (mjordan)

42. (b)
    Perhaps fix the unused interfaces and variables and empty TYPECASES
    in the code generated by m3zume that result from sometimes, but
    not always, having to handle feedback and update events.  (johnh)

43. Perhaps put the files that m3zume generates into the src directory,
    so that folks can find them, rather than into the mips directory
    with the other deriveds.  (steveg)

54. Scaling.  It would be nice if there were some consistent way to
    simply scale all the views (+ code and data views) for big screens
    demos (there is a filter that does scaling - so zeus "only" has
    to install it above all views and provide a mechanism to control
    the scaling) (steveg)
   
56. Beef up data views (cf. #13; steveg) (What does this mean?)

57. Restructure ZeusPanel.m3.  Split into manageable pieces, and
    rationalize the order of the procedures. (johnh)

58. Rework allocation of event argument records in ietem.m3, avoiding
    most allocation and GC.  Create a single mutex argRecMu and create
    a list of arg recs fooArgRecList for each event foo.  The mutex
    is > alg.evtMu.  We could create one mutex per event type, too,
    if we wanted, but it's probably not necessary.  On entering an event
    method, lock alg.evtMu if appropriate (on output events), then
        LOCK argRecMu DO 
          argRec := List.Pop(fooArgRecList); 
          IF argRec = NIL THEN argRec := NEW(); END;
        END;
        <set fields of argRec>
    Just before exiting, and before releasing alg.evtMu if appropriate,
    do
        LOCK argRecMu DO 
          fooArgRecList := List.Push(fooArgRecList, argRec); 
        END;
    The idea of this is that a single sequential or parallel algorithm
    will allocate at most one record per event type, since at most one
    event of each type may be active per algorithm (thanks to alg.evtMu
    [see #29] and VBT.mu).  If there are k algorithms running in
    parallel, they will allocate at most k records for each event type.

59. Rework snapshot/restore to use FormsVBT snapshot more inside
    ZeusPanel. (johnh)

60. Change signature of restore method to take a reader, rather than
    a list. (mhb [najork, johnh])

61. Allow subtypes of algs and views. this way, when 
    I add a slew of events for shellsort, i would do so in shellsort.evt, 
    not sort.evt. we talked about the hacking in m3zume that would 
    be necessary, and it seemed remarkably simple. (mhb)

62. Having a simple way for a view to cause zeus to grey it 
    out would be useful for views that require special hardware, 
    e.g., sound and 3d. i was set to add an entry to ZeusPanel, but 
    you have it checked out.... (mhb)

63. In a snapshot file, store the coordinates of windows relative to 
    the screen. In this way, snapshots created on one display can be
    used on a different-sized displays.

64. Allow views to be alertable, so that long-running event animations
    can be terminated.  This is to correct the problem that it's not
    very hard to crank the per-event delay up to much longer than anybody
    wants to wait.  To do this, we'd have to change the RAISES clauses
    of various procedures in Zeus.m3, as well as add a bit of code in 
    ZeusPanel.m3 to do the alerting.  (steveg)


(******** THESE ARE DONE ***********)

2.  Fix and document locking levels --DONE

3.  Integrate code and data views --DONE

4.  Use one thread per view, with Signal to pass control.  Saves cost
    of forking and garbage-collecting threads. --DONE

7.  Hide the fact that Algorithms are ReactivityVBTs.  Declare a
    ZeusClass.T to be a VBT.T, and let Views know that it's really a
    ReactivityVBT.T, but don't tell Algorithms. (mhb)

8.  Scripts (more than snapshots).  Idea: use the virtual clock that's
    used for synchronizing algorithms as a timer to schedule events.
    We'd want some kind of a recording of a demo: the user does a demo,
    and the system records it for later playback. (mhb)

    More scripts:  We'd like some way to force user interaction, say
    a pause while the user types something.  We have something like this
    with the ZeusPanel.Pause procedure. (mhb)

9.  Count events as they happen, to enable a simple form of empirical
    analysis.  Probably use the Event Data form.  To avoid slowing Zeus
    down too much, perhaps write out the event counts only every second
    or so. (several)

11. Bug: delay isn't effective when two algorithms are running. (heydon)
    --FIXED

12. Unify delay control: use the control panel slider to control both
    animation delays and delays for non-animated views.  To do this,
    add code to PostEventCallback (or perhaps to PanelThread, or to
    both) that sleeps for whatever remains of the event's allotted time.
    In the animated case, there will be no sleep at all; in the
    non-animated case, this will be like the current delay. (johnh)

14. Work on the shape method of a View.T so that restore really does
    restore the shape that was saved by the snapshot method. (johnh)

15. Session restore format is too fragile.  Robustify it to make it
    like the global restore procedure, with a loop and a TYPECASE.
      "Snapshotting Alg & DataForm & EventData: I hacked to make it work,
       but I think that your format is too fragile, You should loop for
       each sub-expression, and then do something based on the keyword
       heading the sub-expression. You do this in RestoreFromList."
    (mhb)

20. Don't stop after an event to which no view listened. (kalsow,
    mjordan) --DONE

21. Views not yet attached to an algorithm should not persist invisible
    after the user deletes them.  (mhb) --DONE

22. Call reactivity method as part of default init method. (mhb) --DONE

23. Set reactivity on transcript to ON. (mhb) --DONE

24. Remove 'Events' label and use thinner border in "Event Data" .fv
    template file. (mhb) --DONE

28. The views that Zeus recreates for me when restoring are a little
    lower than they were when they were snapshotted.  On repeated cycles
    of snapshot and restore, the resulting effect is that my views fall
    off the bottom of the screen! (ramshaw)

    I'll look into the problem with floating restorations; it may be
    impossible to fix because X doesn't tell you about the dimensions
    of the window manager's frame. (mhb)

29. Add a mutex on an Algorithm.T that is locked just before generating
    an output event.  This will prevent multiple output events from
    occurring at the same time, and will prevent the disaster that
    would otherwise follow from using change #4 in the context of a
    parallel algorithm. (johnh) 

30. Marc, a bug seems to have crept into the snapping-shut behavior
    of the Zeus control panel in the vertical direction.  If I open
    the Algorithm subwindow (the top pane) and then open the Input
    subwindow (the middle pane), closing the Input subwindow gives extra
    space to the Algorithm pane, rather than snapping the whole control
    panel to a smaller size, (ramshaw) --DONE (see following)

    I took off the stretch in the "Algs" pane; there still is stretch
    in the "Events" pane, but this isn't as important, since that pane
    isn't used too much.  In any event, we can still do better in the
    Zeus control panel UI, I feel. (mhb)

31. Fixed a handful of glitches: (done by mhb) --DONE

    - Now you can only change algorithms, add or change a session, or 
      use the restore shortcut when there are no algorithms running.
    
    - The control panel is always stretchy horizontally
    
    - Restore now correctly restores the speed. 

32. ZeusPanel needs to call Zeus.SetEventTimeScale(sess,
    panel.speedScale) when a new session is picked.  It is only calling
    SetEventTimeScale when the speed is changed interactively.  Thus,
    restoring the speed was giving the right number and slider position,
    but it didn't have the right effect.  Also hacked a bit to make
    dormant restore shortcut, et. al. unless S=Idle.  --DONE (by mhb)

33. John, it is a bit presumptuous of Zume to appropriate the parameter
    name "r" for its Args-records.  I tried to use "r" as a parameter
    in one of my events, and got burned.  Changing to "Zume_r" would
    surely be safe, although perhaps ugly... (ramshaw)

34. The ABORT ALG and DELETE SESSION buttons really are not needed
    when there is only one session.  It would be nice be able to get
    rid of them, to streamline the common case. (mhb)

38. A known way to crash Zeus:  Hit ABORT after you've paused (i.e.,
    STEP or PAUSE) the algorithm.  The crash is because
    ZeusPanel.Panelthread is doing an AlertWait on a mutex that it has
    not locked.  (mhb) --FIXED

40. More format ideas:  The should be a way to collapse the control
    panel.  Especially for Forum demos!  Independently, there should
    be a way to collapse the section containing the alg and view
    browsers -- perhaps put them in menus?  Also, it might work out
    to put the events into its own top-level window.  (mhb) --PARTIALLY
    DONE

42. (a) Fix uncaught exception warnings in the code generated by m3zume.

44.
    I ran into a case where two derived refs were identical and thus 
    the two types share a single typecode which breaks the dispatcher.
    All the derived should be BRANDED REF RECORD ... (steveg) --FIXED
    (see following)

    i shipped m3zume... (mhb)

     - BRANDED added to IE's REF RECORD
     - <foo>Alg.* => <foo>AlgClass.*
     - <foo>View.* => <foo>ViewClass.*
     - messages start with "m3zume" rather than "Zume"
     - updated man page

45. 
    Modula3 does not allow duplicated imports.  My Tree.evt (all files 
    in ~steveg/wds/zeusalgs/src) imports VBT.  The generated TreeTranscriptView
    tries to import VBT twice and the compiler is unhappy. (steveg)
    --FIXED

46. (previously completed; src/ui/1086)
    1. Views are now titled "<algname>: <viewname>" (Hania)
    
    2. Bogus sessions in the .zeusState/Final_State snapshot file don't
       cause their names to be listed in the Sessions menu.  In this
       situation the restore operation fails, and the default algorithm
       and views are selected. (mhb, johnh)
    
    3. When views and in-Trestle sessions are restored, Zeus now checks
       more carefully whether their saved screen location is valid in the
       current configuration and, if not, lets the window manager put the
       windows where it wants to. (guarino)
    
    4. When an algorithm is selected, it stays highlighted in the browser.
       (meehan)
    
    5. The ZeusPanel interface for registering algorithms and views has
       changed.  The third parameter to RegisterAlg and RegisterView is
       now called "sessName" and has no default value.  The comments now
       state that this parameter must be set to the basename of the .evt
       file.  To change the name under which the session appears in the
       Sessions menu and in the session and control panel forms, use the
       new procedure SetSessTitle.  (mhb, guarino, saxe)

47. (previously completed; src/ui/1095; m3zume fix)
    Corrects the problem noted by Sclafani and others that the internal
    version of the "stop at code view events" flag is initially inconsistent
    with the FormsVBT interactor for it (symptom: stepping doesn't work
    right for code view events).

48. (previously completed; src/ui/1095)
    1. The current algorithm name is always highlighted in the Algorithms
       browser. (heydon)
    
    2. There is now only one .zeusState directory; it is a subdirectory
       of your home directory.  This should reduce the proliferation of
       .zeusState directories and make the results of automatic
       snapshot/restore more predictable.  (mhb)
    
    3. Destroying the session in the Zeus control panel sets the panel's
       session name to "Null."  (heydon)
    
    4. Widened the "About.." dialogue so the "delay" text field doesn't
       get clipped.  Lightened the color of the "Destroy" button to make
       it less prominent, made its name more explicit ("Destroy Session").
       Changed the Anim Speed slider to full width. (heydon, ramshaw)

49. (previously completed; src/ui/1113)
    1. Animations in separate views should now occur in parallel, rather
       than sequentially.  Unfortunately, they will also run slower, at
       least until the next round of Zeus performance improvements.  
       (hania, johnh)
    
    2. Restore doesn't try to position a window at all if the remembered
       position is invalid in the current screen configuration.  (mjordan)
    
    3. The procedure AlgReady has been removed from the ZeusPanel interface.
       This should have no impact, since no one used it. (johnh)

50. (previously completed; src/ui/1131)
    1. Compliance with the z-locks document.  Update events are declared
       in the .evt file using the keyword UPDATE.  The view update event
       methods are named ue<EventName>, just as the output event methods
       are named oe<EventName>.
    
       The ZeusClass, Algorithm, and View interfaces have changed.  The
       startrun and endrun methods have moved from ZeusClass to View;
       algorithms no longer have these methods.  A ZeusClass.T now has
       a reactivity method.  
    
       The signature of the <Foo>IE.<Event> procedures has changed.
       Formerly, the last argument was a Zeus.EventStyle that could be used
       to tell Zeus that an output event was really an update event.  Now
       that update events are supported directly, that argument has been
       deleted.  This may require minor source changes from some users.
    
    2. Locking levels have been cleaned up inside Zeus, and locking level
       comments added to all the interfaces.  This has the unfortunate
       side effect that the crash-on-quit occurs much more reliably. 
       This appears to be a Trestle bug.
    
    3. The event data form now is scrollable, to allow for large event
       sets. (ramshaw)
    
    4. Selecting a view when there is no algorithm should no longer crash
       Zeus. (steveg)

51. (previously completed; src/ui/1133)
    1. Views that are created, then deleted before the algorithm is run
       no longer persist in an invisible state, receiving events. (mhb)
       This is #21 above.
    
    2. All active sessions get their feedback events enabled when the user
       pauses Zeus.  Formerly, it could require multiple clicks on the Step
       button to get feedback enabled for all sessions. (johnh)
    
    3. Removed a deadlock that occurred when multiple sessions had
       algorithms running and one of the sessions was destroyed. (johnh)

52. History views, probably under user control, that record all the
    views on the screen in miniature form, probably by remembering
    the display state of each leaf VBT, using a scale filter on top
    of each one to shrink it down.  Format would  probably be a 2D
    array, with different views stacked vertically, and time
    increasing to the right. (steveg)
    Done by steveg.  Hooray!

    A minor variation on 52 is to have a history view be of a particular 
    other view, snapshot on a user-specified event. In any event, mgkit 
    contains a (preliminary?) version of  VBTSnap and VBTAlbum to make 
    a bitmap of an arbitrary VBT. (mhb)

53. (Sorted?) order of sessions in menu.  In a zeus with multiple
    sessions (likely to become common) there should be some defined
    (definable) order on the sessions in the menu.  (steveg)
    Make Alg and View browsers be sorted, too. (mhb)
  
55. Move eventtime to mg. (steveg)

