SpiNNakerManchester / DataSpecification

Data Specification Generation and Execution
Apache License 2.0
3 stars 4 forks source link

Keep track of last known memory pointer in a region in DSG and use it for error trapping #8

Open rowleya opened 8 years ago

rowleya commented 8 years ago

It is, in general, impossible for DSG to know if a region will overflow during DSE, since the code might have for loops etc. However, it could have a general idea as follows:

  1. Keep track of the last known write position for each region
  2. Update the last known write position whenever the pointer is set to an absolute value, a write is called or a write array is called.
  3. Raise an error if the last known write position is beyond the end of the region.

This should work reasonably well, although I am still not sure it is flawless... only testing would tell!

dkfellows commented 2 years ago

Nobody uses looping in DSE, and never did; it was never supported. Given that all writes are basically linear fills within a region (albeit not always generated in order into those regions), we most definitely can know if writes go out of where they should.

The DSE definitely checks whether writes are within their region. It's a check that's done immediately before the update of the raw region data, in both the Python and Java versions. Nothing will ever actually be written to memory except into a region (or to the region metadata, of course). We've never observed such a failure to date, so I'm not worried to work on this.