| Crates.io | infmachine |
| lib.rs | infmachine |
| version | 0.1.0 |
| created_at | 2025-05-31 12:27:54.623546+00 |
| updated_at | 2025-05-31 12:27:54.623546+00 |
| description | The Infinite Machine. |
| homepage | |
| repository | https://github.com/matszpk/infmachine |
| max_upload_size | |
| id | 1696328 |
| size | 296,868 |
This is library provide the execution environment for the Infinite machine. Execution environment allow to run machines at CPU and GPU using an OpenCL devices. A machine executed in parallel way and massive processors of that machines are executed parallel way. It possible to run machines with multiple millions processors simultaneously thanks limited states and memories of that processors.
The library uses gatesim library to operate on machine's circuits.
The library uses gatenative library to run machine and simulate circuit execution of
that machines.
The Infinite Machine is simple model of infinite machine that has infinite memory and infinite number of processors. Machine described by circuit that has inputs and outputs.
The machine contains main memory. Main memory shared by every processor and it can be read and written by any processor. Main memory address starts from 0 and no end of this memory. Main Memory cell length is power of two.
Next type of memory is mem_address - memory address. Any processor has own private
memory address and no other processor can access to this memory address.
Memory address is sequential memory with start and no end. Position of memory address
points to current part of memory address. Length of part of memory address
specified by data part length and it can be any non-zero number. Processor can
move position of memory address forward and backward. Memory address points
main memory cell of that address that will accessed by processor.
Additional type of memory is temp_buffer - temporary buffer. Temporary buffer
is only name of that memory and it means usage of that memory.
Any processor has own private temp buffer and no other processor can access
to this temp buffer.
Same memory is not temporary. Likewise memory address, temp buffer is sequential memory
divided by data parts of length specified by data part length and given position
can be moved forward and backward as in memory address.
Processor id is private read only memory that contains processor id (private number of processor). It is sequential memory likewise memory address of temp buffer.
Internal data is memory address and temp buffer.
Any read or write from/to memory address or temp buffer can be done to its part
of length data part length at current position.
Read from memory address or temp buffer done before write to same part of that memory.
Position going to be changed after any access to part of internal data.
Three parameters defines machine:
Execution of machine divided by cycles. Cycle stage in library starts from 0. Cycles divided by four stages:
Initial state of machine is all memories and positions are zeroed.
Read from main memory will be done parallel way in stage 2. Write to main memory done in stages 3 and 4. Any cell of main memory going to be cleared before write in stage 3. In stage 4 aggregated write to cell of main memory done by making logical OR operation on bits of cell with all writes from all processors. If any processor writes 1 to some bit same cell of main memory then will be 1 in this bit, otherwise bit will be 0.
For model that includes infinite processors we distinguish unique processing: processor that doing different processing by writing different values to memories and having different states. Number of unique processing for any cycle are finite. Main memory writing is computable because: for bit that not set to 1 no processor that store this bit and no duplicate of processor that do it, for bit that set to 1 any duplicate of processing make same operation. For bit that set 1 it requires to only one processor to set that bit, other processor doesn't change result.
Details of circuits. The circuit of machine describes behavior of machine. Input of circuit is:
[STATE, MEMCELL, DATAPART, DATAPART_MOVE_DONE].
Output of circuit is:
[STATE, MEMCELL, DATAPART, MEMRW, DATAPART_RW, DATAPART_MOVE_DIR, DATA_KIND, STOP_MACHINE].
Descriptin of fields:
Illegal state means in only executor environment, but not in machine model. Illegal state happens if any processor try write memory above specified size, move position above maximal value, write internal data above maximal size. Any read above specified size or maximal length are legal and causes read zeroes.
Example machines in infmachine_examples. Toolkit to create machines is infmachine_gen.
Executor and debugger of machines is infmachine_exec.