summary refs log tree commit diff stats
path: root/tests/vm
Commit message (Collapse)AuthorAgeFilesLines
* fix #14340 (#16386)Timothee Cour2021-01-011-0/+17
|
* use doAssert in tests (#16486)flywind2020-12-2812-24/+24
|
* [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)Timothee Cour2020-12-221-0/+4
| | | | | * fix #16428 vmops now works for generic procs * remove duplication
* fixes #16069; [backport:1.2] [backport:1.4] (#16115)Andreas Rumpf2020-11-241-1/+19
| | | | | * fixes #16069; refs https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] [backport:1.4] * make tests green again
* fix #16025 repr now consistent: does not insert trailing newline (#16034)Timothee Cour2020-11-191-3/+2
|
* Revert "follow #16009 VM supports cast nil to ptr (#16012)"Andrey R (cooldome)2020-11-171-30/+0
| | | | This reverts commit fec19c980e36e62747eb119f0740cb785e858ac3.
* follow #16009 VM supports cast nil to ptr (#16012)flywind2020-11-171-0/+30
| | | | | * follow #16009 VM supports cast nil to ptr * more testcase
* close #11637(add testcase for #11637) (#15879)flywind2020-11-081-0/+52
| | | | | * close #11637(add testcase for #11637) * Update tests/vm/t11637.nim
* fix #15463 (#15831)flywind2020-11-051-1/+11
|
* Closure iterators are not supported by VM (#15818)flywind2020-11-021-0/+9
|
* fixes #15717flywind2020-11-021-0/+19
|
* [backport] fix #15595 procvar `==` works in VM (#15724)Timothee Cour2020-10-261-0/+24
|
* fix #15704 #15597 wrong VM register was freed (#15705)Timothee Cour2020-10-261-0/+130
| | | | | | | | | | | | | * fix #15704 #15597 wrong VM register was freed * same treatment for nkCheckedFieldExpr * note concerning HighRegisterPressure * bump NimPatch * Update lib/system.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* close #8007 (#15695)Timothee Cour2020-10-231-0/+51
|
* fix #15662 (#15678)cooldome2020-10-231-0/+5
| | | | | | | * fix #15662 * alternative fix * fix spacing
* Add tests to #15363 (#15633)Danil Yarantsev2020-10-191-0/+26
|
* followup after #15529 and #15534 (#15536)Timothee Cour2020-10-101-8/+3
|
* close #13081 (#15529)Timothee Cour2020-10-091-0/+31
| | | | | * close #13081 * fixup
* 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