Post Reply 
How much memory may a HPPL program use on a G2?
09-22-2023, 07:47 PM
Post: #89
RE: How much memory may a HPPL program use on a G2?
(09-22-2023 07:29 AM)komame Wrote:  
(09-21-2023 07:59 PM)jte Wrote:  While I didn't design or implement PPL, I've implemented special-case handling in some parts of the project. The Function app, for example, doesn't use the main PPL interpreter for the sorts of things typically graphed by high-school students. Instead, it uses something closer to a "bytecode" interpreter. Before graphing begins, the PPL (the part after the "F1(X)=") is analyzed. If it is of a simple-enough form to fit the special-case interpreter, a simple list of instructions is generated for an abstract machine (of a "push" form - things like "add register 1 to register 5, put the result in register 7"). Things like common subexpressions are recognized and only evaluated once (when evaluating a user-defined function for a particular value).
I don't fully understand. After all, PPL is also a bytecode interpreter. Is what you're analyzing the result of tokenization by the PPL mechanism, or is a different bytecode generated for your mechanism?

Yes, for the Function app, there is another evaluation engine that handles formula evaluation for when the PPL is simple enough (for this alternative evaluation engine to handle). This second engine doesn't, for example, handle strings or matrices or lists, ... (or branching...) The restrictions allow the engine to preallocate storage and simply run through a series of floating-point function evaluations.

The input to the analysis is not raw strings, but internal structures used by the PPL system. (The analysis doesn't need to [re-]do tokenization, doesn't need to [re-]handle precedence rules etc.)

I first implemented this second evaluation engine (and associated "bytecode") that targets BCD floating-point evaluations for the Graph 3D app; there it can allow for substantially fewer BCD evaluations. For example, for a 40x40 grid of points, evaluating SIN(X)*COS(Y), with this alternative engine, uses 40 SIN evaluations and 40 COS evaluations (not 1,600 each) and 1,600 BCD multiplications. (For the "value" evaluations; there are also the evaluations of partial derivatives, for lighting.)

The Advanced Graphing app needs its own evaluation engine as it uses structures (floating-point intervals) not currently present in PPL. (It too crawls over internal PPL structures to produce its plans for evaluations to come.)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How much memory may a HPPL program use on a G2? - jte - 09-22-2023 07:47 PM



User(s) browsing this thread: 1 Guest(s)