Skip to content

Compile execution constraints for optimistic precompiles #3495

@georgwiese

Description

@georgwiese

In order to get optimistic precompiles (#3366) working in practice, we need to be able to decide whether we can use the precompile already at execution time. For this, @Schaeff (in #3491) has introduced a constraint language that can be evaluated at execution time. It basically allows us to test A == B where A and B are either a constant or a tuple of (relative timestamp, register, value).

Important

As of now, #3491 can only compare entire values (looking at these datastructures). What we actually need to compare is limbs of values. That seems like a simple generalization though.

My current understanding is the following:

We want to filter both range constraints and equivalence classes for columns that are limbs of (intermediate) register values. The hope is that that filters out mostly things that the solver can derive anyway. Looking at the removed columns here, this might be the case, although it is also very common for the most significant limb of the time stamp diff to be zero, which is something that we would miss.

Finding limbs of intermediate register values can be done by looking at the memory bus interactions of the original instructions: If (1) the address space and address is constant, and (2) the data is just a list of columns (no complex expressions), we have our (relative timestamp, register, value limb) tuples. Conditions (1) and (2) would often be true I think, but e.g. in the load/store chip, it requires some solving to know which are the bus interactions that go to RAM and which go to a register.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions