An Object-Oriented Simulator for the Apiary

Henry LiebermanAAAI 1983

Introduction

In the early 1980s, the limitations of serial von Neumann architectures became increasingly apparent as artificial intelligence research progressed. Traditional high-performance computing was optimized for static, predictable "physics-style" problems with tight inner loops. AI workloads, by contrast, are dynamic and unpredictable, requiring hardware that offers flexibility and efficient resource management rather than just raw bit-manipulation speed. In "An Object-Oriented Simulator for the Apiary" (AAAI-83), Henry Lieberman introduces a simulator for a proposed parallel machine designed specifically to handle the "messiness" of AI through the Actor model of computation.

The Actor Model and Worker Architecture

The Apiary departs from the central CPU model, instead utilizing a network of "Workers"—individual processors that communicate through message passing. The fundamental unit of computation is the "Actor," an object that responds to messages by performing local actions, creating new actors, or sending further messages.

The simulated machine architecture is composed of several specialized components within each Worker. A Communications Processor manages incoming and outgoing messages, while Work Processors execute the logic of the actors. Central to each Worker is a Work Queue, which holds pending tasks.

The internal architecture of an Apiary Worker, featuring specialized processors for communication, execution, and garbage collection.

Tasks as First-Class Objects

A key innovation of the Apiary is the representation of machine state. In a traditional computer, state is a collection of registers and a program counter. In the Apiary, the state of a process is encapsulated within a Task object. A Task represents a single message arriving at a target actor, containing the target, the message content, and a "customer" (the continuation actor to which the result should be sent).

This object-oriented approach to state makes process switching and migration between physical processors significantly faster and more flexible. When a Work Processor is idle, it simply dequeues a Task object and begins execution based on the "script" associated with the target actor.

The execution cycle of a Work Processor, illustrating how tasks are dequeued and processed into new instructions and messages.

Implementation and Simulation Mechanisms

To test these concepts, Lieberman developed a simulator on the MIT Lisp Machine. To manage the complexity of parallel execution on serial hardware, the simulator employs a TICK mechanism, where each TICK message represents a single processor cycle across the entire simulated network.

Furthermore, the paper introduces Scripter, a high-level compiler that translates Lisp-like code into the Apiary’s virtual machine language. Because the Actor model relies on unidirectional message passing, Scripter automatically converts functional code into continuation-passing style. This eliminates the need for a traditional call-and-return stack, which often acts as a bottleneck in parallel systems.

Key Insights and Results

The simulator demonstrated several critical capabilities for parallel AI systems:

  • Infinite Processor Abstraction: Similar to virtual memory, the Apiary allows programmers to write code as if they have access to an infinite number of processors, with the system automatically handling load balancing.
  • Dynamic Load Balancing: The system successfully migrates tasks from overloaded Workers to idle neighbors in real-time.
  • Object Migration: Actors can move between the memory spaces of different processors during execution, using "forwarding pointers" to maintain communication integrity.
  • Reversible Debugging: The object-oriented nature of the simulator allowed for the creation of a "stepper" that can move both forward and backward through the state of the parallel machine, a vital tool for debugging non-deterministic events.

Conclusion and Future Work

While the Apiary simulator provided a powerful proof-of-concept, Lieberman noted significant performance overhead due to the high level of abstraction. At the time of publication, the transition from Lisp-based simulation to physical hardware was still ongoing. However, the paper laid the groundwork for understanding how object-oriented principles could be applied to the very architecture of parallel machines, moving beyond the constraints of the von Neumann model to meet the unique demands of artificial intelligence.

Summary updated

BibTeX
@inproceedings{lieberman1983object,
  author = {Henry Lieberman},
  title = {{An Object-Oriented Simulator for the Apiary}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {1983},
}
Figure