Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added initial specification of addition and subtraction of integers #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smarr
Copy link
Member

@smarr smarr commented Nov 29, 2020

This addresses part of #20.

This is a very first step in the direction of having a specification for SOM.
For the moment, this is not more than a specification of integers and addition/subtraction.
Doubles are not yet included in the spec.

A readable version is currently here: https://github.com/smarr/SOM/blob/int-add-spec/specification/index.md
It is kept brief to see whether there's any general feedback (perhaps by @ltratt or @krono).

The code examples in the spec are extracted and used to generated the tests that are part of this PR using https://github.com/smarr/GigaGenSOM/
The resulting code is not very human readable, since it's rather long.
The generated tests are supposed cover all relevant combination of values, which is especially important for Truffle-based interpreters, but not only as #20 showed.

Minor maintenance:

  • disable PySOM testing (which is distinct from RPySOM)
  • and RPySOM is expected to work

@smarr smarr added the spec Needs specification, or is specification related. label Nov 29, 2020
@ltratt
Copy link

ltratt commented Nov 29, 2020

This looks like a good start to me! FWIW on yksom:

$ cargo run --release -- --cp SOM/Smalltalk:SOM/TestSuite/ SOM/specification/executable_specs/AllSpecs.som
          3,440   0%    7.39kB/s    0:00:00 (xfr#1, to-chk=0/4409)   
    Finished release [optimized] target(s) in 0.04s
     Running `target/release/yksom --cp 'SOM/Smalltalk:SOM/TestSuite/' SOM/specification/executable_specs/AllSpecs.som`
Total number of tests:           24
Number of unsupported optionals: 0
Number of successful tests:      24
Number of assertions tested:     30458

which I think is the expected output?

@krono
Copy link
Member

krono commented Nov 30, 2020

Neat!

(i've done number testing for RSqueak a bit differently, but with a similar goal.
Spec testing is good, tho)

@smarr
Copy link
Member Author

smarr commented Nov 30, 2020

@krono is it actually that different?
You got a nice parametrizable testing framework, and I suspect, you won't need to worry about order dependencies for Truffle specializations, but otherwise, it's a set of operations and a possible set of input numbers, if I understand correctly, right?

Think the difference is mainly that I generate the testing code, and haven't shown yet the specs for the other operations, but the goal is to cover them all. I also generate loops that traverse an array/vector with the data in different orders. Is there something more you might be doing?

The original reason for writing the code generator was to be able to produce large programs, and have something to measure cold-code performance. Whether that's going to work, I haven't tried yet, but I thought, such specs might count as "useful" programs worth benchmarking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Needs specification, or is specification related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants