summary refs log tree commit diff stats
path: root/tests/vm
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated stuff from stdlib (#14699)Miran2020-06-172-2/+2
| | | | | | | * update to the latest Jester * remove deprecated procs from some stdlib modules * 'criterion' is not maintained anymore and relies on obsolete stuff
* `nim doc --backend:js`, `nim doc --doccmd:-d:foo`, `nim r --backend:js`, ↵Timothee Cour2020-05-111-0/+1
| | | | | | | | | | `--doccmd:skip` + other improvements (#14278) * `nim doc --backend:js|cpp...` `nim doc --doccmd:'-d:foo --threads:on'` `nim r --backend:cpp...` (implies --run --usenimcache) * --usenimcache works with all targets * --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
* tslow_tables: wait for an additional 2 seconds (#14266)alaviss2020-05-071-1/+1
| | | | | | | | This test runtime tends to hover around the 5s mark depending on how loaded the system currently is. This causes the test to fail a lot during CI, per analytics: https://dev.azure.com/nim-lang/Nim/_test/analytics?definitionId=1&contextType=build Give the test an extra 2 seconds to account for unrelated overhead.
* fix regression: -d:nimHasLibFFI was not being tested anymore (#14234)Timothee Cour2020-05-061-13/+17
| | | | | | | | * * fix regression: -d:nimHasLibFFI was not being tested anymore, in part because testament was silently treating some errors as easy to overlook messages * turned that message into an error * -d:nimHasLibFFI is now being tested with nim cpp * use correct signatures for importc procs * workaround for openbsd to unblock ctffi testing
* discardable async procs are now an error (#14176)hlaaftana2020-05-011-1/+1
| | | | * add discard warning in manual
* Add `hashWangYi1` (#13823)c-blake2020-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Unwind just the "pseudorandom probing" (whole hash-code-keyed variable stride double hashing) part of recent sets & tables changes (which has still been causing bugs over a month later (e.g., two days ago https://github.com/nim-lang/Nim/issues/13794) as well as still having several "figure this out" implementation question comments in them (see just diffs of this PR). This topic has been discussed in many places: https://github.com/nim-lang/Nim/issues/13393 https://github.com/nim-lang/Nim/pull/13418 https://github.com/nim-lang/Nim/pull/13440 https://github.com/nim-lang/Nim/issues/13794 Alternative/non-mandatory stronger integer hashes (or vice-versa opt-in identity hashes) are a better solution that is more general (no illusion of one hard-coded sequence solving all problems) while retaining the virtues of linear probing such as cache obliviousness and age-less tables under delete-heavy workloads (still untested after a month of this change). The only real solution for truly adversarial keys is a hash keyed off of data unobservable to attackers. That all fits better with a few families of user-pluggable/define-switchable hashes which can be provided in a separate PR more about `hashes.nim`. This PR carefully preserves the better (but still hard coded!) probing of the `intsets` and other recent fixes like `move` annotations, hash order invariant tests, `intsets.missingOrExcl` fixing, and the move of `rightSize` into `hashcommon.nim`. * Fix `data.len` -> `dataLen` problem. * This is an alternate resolution to https://github.com/nim-lang/Nim/issues/13393 (which arguably could be resolved outside the stdlib). Add version1 of Wang Yi's hash specialized to 8 byte integers. This gives simple help to users having trouble with overly colliding hash(key)s. I.e., A) `import hashes; proc hash(x: myInt): Hash = hashWangYi1(int(x))` in the instantiation context of a `HashSet` or `Table` or B) more globally, compile with `nim c -d:hashWangYi1`. No hash can be all things to all use cases, but this one is A) vetted to scramble well by the SMHasher test suite (a necessarily limited but far more thorough test than prior proposals here), B) only a few ALU ops on many common CPUs, and C) possesses an easy via "grade school multi-digit multiplication" fall back for weaker deployment contexts. Some people might want to stampede ahead unbridled, but my view is that a good plan is to A) include this in the stdlib for a release or three to let people try it on various key sets nim-core could realistically never access/test (maybe mentioning it in the changelog so people actually try it out), B) have them report problems (if any), C) if all seems good, make the stdlib more novice friendly by adding `hashIdentity(x)=x` and changing the default `hash() = hashWangYi1` with some `when defined` rearranging so users can `-d:hashIdentity` if they want the old behavior back. This plan is compatible with any number of competing integer hashes if people want to add them. I would strongly recommend they all *at least* pass the SMHasher suite since the idea here is to become more friendly to novices who do not generally understand hashing failure modes. * Re-organize to work around `when nimvm` limitations; Add some tests; Add a changelog.md entry. * Add less than 64-bit CPU when fork. * Fix decl instead of call typo. * First attempt at fixing range error on 32-bit platforms; Still do the arithmetic in doubled up 64-bit, but truncate the hash to the lower 32-bits, but then still return `uint64` to be the same. So, type correct but truncated hash value. Update `thashes.nim` as well. * A second try at making 32-bit mode CI work. * Use a more systematic identifier convention than Wang Yi's code. * Fix test that was wrong for as long as `toHashSet` used `rightSize` (a very long time, I think). `$a`/`$b` depend on iteration order which varies with table range reduced hash order which varies with range for some `hash()`. With 3 elements, 3!=6 is small and we've just gotten lucky with past experimental `hash()` changes. An alternate fix here would be to not stringify but use the HashSet operators, but it is not clear that doesn't alter the "spirit" of the test. * Fix another stringified test depending upon hash order. * Oops - revert the string-keyed test. * Fix another stringify test depending on hash order. * Add a better than always zero `defined(js)` branch. * It turns out to be easy to just work all in `BigInt` inside JS and thus guarantee the same low order bits of output hashes (for `isSafeInteger` input numbers). Since `hashWangYi1` output bits are equally random in all their bits, this means that tables will be safely scrambled for table sizes up to 2**32 or 4 gigaentries which is probably fine, as long as the integer keys are all < 2**53 (also likely fine). (I'm unsure why the infidelity with C/C++ back ends cut off is 32, not 53 bits.) Since HashSet & Table only use the low order bits, a quick corollary of this is that `$` on most int-keyed sets/tables will be the same in all the various back ends which seems a nice-to-have trait. * These string hash tests fail for me locally. Maybe this is what causes the CI hang for testament pcat collections? * Oops. That failure was from me manually patching string hash in hashes. Revert. * Import more test improvements from https://github.com/nim-lang/Nim/pull/13410 * Fix bug where I swapped order when reverting the test. Ack. * Oh, just accept either order like more and more hash tests. * Iterate in the same order. * `return` inside `emit` made us skip `popFrame` causing weird troubles. * Oops - do Windows branch also. * `nimV1hash` -> multiply-mnemonic, type-scoped `nimIntHash1` (mnemonic resolutions are "1 == identity", 1 for Nim Version 1, 1 for first/simplest/fastest in a series of possibilities. Should be very easy to remember.) * Re-organize `when nimvm` logic to be a strict `when`-`else`. * Merge other changes. * Lift constants to a common area. * Fall back to identity hash when `BigInt` is unavailable. * Increase timeout slightly (probably just real-time perturbation of CI system performance).
* fix some codegen bugs: NIM_BOOL, NIM_STATIC_ASSERT, --passc:-std=... (etc) ↵Timothee Cour2020-04-071-28/+0
| | | | | | | | (#13798) * fix cgen bool D20200328T203812 * --passc:std=c++17 (etc) now works instead of silently ignored * document caveats for NIM_NIL
* fix https://github.com/timotheecour/Nim/issues/88 (#13865) [backport:1.2]Timothee Cour2020-04-061-1/+10
|
* fix `nim doc subdir/foo` which was generating broken css; + other fixes (#13647)Timothee Cour2020-03-171-1/+1
| | | | | | * docgen: minor refactoring via docOutDir * fix css for `nim doc subdir/foo` without --outdir nor -o * tcompilesetting.nim: keep `git status` clean * re-enable pkg nimgame2 that got fixed upstream
* std/compilesettings implementation (#13584)Andreas Rumpf2020-03-041-0/+19
| | | | | | | | * Implement compileSetting() and compileSettingSeq() * Change from magic to vmop * better design for querySetting Co-authored-by: genotrance <dev@genotrance.com>
* enable testing -d:nimHasLibFFI mode (#13091)Timothee Cour2020-02-042-82/+83
|
* VM: allow overriding MaxLoopIterations without rebuilding nim (#13233)Timothee Cour2020-01-231-1/+1
|
* VM FFI: write(stderr, msg) and fprintf(cstderr, msg) now work at CT (#13083)Timothee Cour2020-01-121-0/+13
|
* fixes #13013, reverts previous changes to readLines() (#13036) [backport]cooldome2020-01-051-1/+1
| | | | | | | * Revert "remove default argument for readLines (#12807) [backport]" This reverts commit c949b81efdeb08b38224e1678ad140b7b7663b15.
* remove default argument for readLines (#12807) [backport]cooldome2020-01-021-1/+1
|
* Increased TInstr field sizes: allow long jumps and 65535 VM registers (#12777)Ico Doornekamp2019-12-102-0/+30
| | | | | | | | | * Increased regBx size from 16 to 24 bits to increase jump range in the VM from 32K to 8M instructions. Fixes #12727 * Increased VM TInst register field sizes to 16 bits to allow up to 65535 VM registers per proc * Added test case for >255 VM registers
* fixes #12488 [backport]Araq2019-11-281-0/+17
|
* VM: improvements for var T/addr (#12667); fixes #12489Andreas Rumpf2019-11-283-3/+113
|
* fixes #12670 [backport] (#12693)Andreas Rumpf2019-11-201-0/+20
|
* fixes #12310 [backport] (#12470)Andreas Rumpf2019-10-201-0/+14
|
* fixes #12244 [backport]Araq2019-10-101-0/+20
|
* Fixes #10514 (#12268)Clyybber2019-09-281-0/+15
| | | | | | | | | | * Fixes #10514 (cherry picked from commit f6f789bb4db2a367384ba6ad75706edd503de1f8) * Add comment * Add changelog entry
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* fixes #10981; fixes #7261 (#12217)Andreas Rumpf2019-09-191-0/+99
|
* rename cast opcodes, fix for 32bit cast, fix python pretty printer (#12207)Arne Döring2019-09-181-0/+13
|
* fixes the testcaseAraq2019-09-171-2/+1
|
* added a testcase for #12195; testament now supports a 'timeout' spec fieldAraq2019-09-171-0/+31
|
* allows access to .compileTime vars at runtime (#12128)Andreas Rumpf2019-09-051-1/+10
|
* makes more tests greenAndreas Rumpf2019-09-021-2/+2
|
* makes test green againAraq2019-09-021-3/+3
|
* fixes #11903 (#11908)Arne Döring2019-08-311-0/+13
|
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-1/+1
| | | | * fixes #11847
* fixes #9829 (#11849)Arne Döring2019-08-041-0/+15
|
* VM exception fixes (#11868)Oscar Nihlgård2019-08-021-0/+14
|
* Fix VM conversion to var type [bugfix] (#11866)Oscar Nihlgård2019-08-011-0/+5
|
* fixes tcompiletimerange [bugfix] (#11720)Andreas Rumpf2019-07-121-5/+4
|
* [bugfix] VM: finally do inheritance properlyAraq2019-07-121-10/+24
|
* fixes #11610 (#11659)Andreas Rumpf2019-07-051-2/+14
|
* VM can now cast integer type arbitrarily. (#11459) [feature]Arne Döring2019-06-101-0/+128
|
* make megatest work with 'koch boot -d:release' tooAraq2019-06-051-0/+4
|
* make fullpaths the default in error messages and stack traces for mor… ↵Andreas Rumpf2019-06-051-1/+1
| | | | | | | | | | | | (#11385) * make fullpaths the default in error messages and stack traces for more convenient development * split up -d:release into -d:release and -d:danger flags * workaround a Nim config parser bug * fixes an old nim config parser bug * make megatest green again * make nimpretty tests work again * make nimsuggest green
* close #8199 by adding a testnarimiran2019-05-291-0/+25
|
* make tests greennarimiran2019-05-281-0/+1
|
* tableinstatic test: make it arch-independednarimiran2019-05-271-2/+1
|
* Allow void macro result (#11286)Arne Döring2019-05-213-5/+5
| | | | | * allow void macro result * add test for void macro result type
* Fixes #11045. Assigning a proc to const and invoking. (#11076)Aditya Siram2019-05-041-0/+18
|
* Compiler plugin for implementing incremental computation in user space (#10819)cooldome2019-04-112-0/+47
| | | | | | | | | | This plugin provides essential building block for implementing incremental computations in your programs. The idea behind incremental computations is that if you do the same calculation multiple times but with slightly different inputs you don't have to recompute everything from scratch. Also you don't want to adopt special algorithms either, you would like to write your code in standard from scratch manner and get incrementality for free when it is possible. The plugin computes the digest of the proc bodies, recursively hashing all called procs as well . Such digest with the digest of the argument values gives a good "name" for the result. Terminology loosely follows paper "Incremental Computation with Names" link below. It works well if you have no side effects in your computations. If you have global state in your computations then you will need problem specific workarounds to represent global state in set of "names" . SideEffect tracking in Nim also useful in this topic. Classical examples: Dashboard with ticking data. New data arrives non stop and you would like to update the dashboard recomputing only changed outputs. Excel spreadsheet where user changes one cell and you would like to recompute all cells that are affected by the change, but do not want to recompute every cell in the spreadsheet.
* fixes #10886 [backport] (#10897)Andreas Rumpf2019-03-231-0/+18
|
* added system.default in order to prevent the abstraction inversion that ↵Andreas Rumpf2019-03-051-1/+26
| | | | 'template default(T): untyped = (var x: T; x)' causes
* disable compile-time FFI supportAndreas Rumpf2019-02-231-1/+1
|