[TBENCH-16] Add performance testing for STM Created: 23/Feb/12 Updated: 23/Feb/12 |
|
| Status: | Open |
| Project: | test.benchmark |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Stefan Kamphausen | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | performance, test | ||
| Environment: |
64bit Linux, Quad-core |
||
| Attachments: |
|
| Description |
|
Write a test-suite to detect regressions in STM performance. |
| Comments |
| Comment by Stefan Kamphausen [ 23/Feb/12 2:38 PM ] |
|
Patch which adds an stm-namespace containing a collection of performance test functions. |
[LOGIC-44] ex* could expand macros in patterns Created: 19/Jul/12 Updated: 17/Mar/13 |
|
| Status: | Open |
| Project: | core.logic |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Joe Osborn | Assignee: | David Nolen |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | enhancement, patch, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
So, tagged data structures are probably interesting in a relational context. Say you have a relation with some default logic about dogs: (defna friendlyo [Dog-Or-Breed]
([:Spot] succeed)
([:Spike] fail)
([Other-Dog] (fresh [Breed] (dog-breed Other-Dog Breed) (friendlyo Breed)))
([(breed :miniature-dachshund)] fail)
([(breed :golden-retriever)] succeed)
;. . .)
Assume there's a (defmacro breed [t] `[:breed ~t]). That's nicer than having to drop [:breed :golden-retriever] in there or whatever, since it's compile-time-checkable, less error-prone, reduces duplication, etc. This little patch makes ex* expand macros in patterns so it doesn't treat e.g. (breed :golden-retriever) as introducing a new LVar called "breed". Test also provided. |
| Comments |
| Comment by David Nolen [ 19/Jul/12 4:41 PM ] |
|
I'm surprised that this doesn't already work. We have support for unifying expressions in the pattern already. Look at line 1230 in tests.clj in the master branch. So this should just work, no need to explicitly support macros as far as I can tell. If it's not working, then there's a bug. |
| Comment by Joe Osborn [ 19/Jul/12 5:18 PM ] |
|
At least on 0.7.5, matching against a macro gives a runtime error: Exception in thread "main" java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to clojure.lang.IFn at rl.core$glyph_$fn__123$fn__144$fn__165$fn__166$_inc__167$fn__168.invoke(core.clj:61) at clojure.core.logic.Substitutions.bind(logic.clj:211) at rl.core$glyph_$fn__123$fn__144$fn__165$fn__166$_inc__167.invoke(core.clj:58) at clojure.core.logic$fn__1056$_inc__1057.invoke(logic.clj:1160) at clojure.core.logic$fn__1056$_inc__1057.invoke(logic.clj:1160) at clojure.core.logic$fn__898$_inc__899.invoke(logic.clj:823) at clojure.core.logic$fn__890$fn__891.invoke(logic.clj:828) Using a fn instead of a macro gives the same: Exception in thread "main" java.lang.ClassCastException: clojure.core.logic.LVar cannot be cast to clojure.lang.IFn at rl.core$drawable_$fn__235$fn__248$fn__249$_inc__250$fn__251.invoke(core.clj:67) at clojure.core.logic.Substitutions.bind(logic.clj:211) at rl.core$drawable_$fn__235$fn__248$fn__249$_inc__250.invoke(core.clj:65) at clojure.core.logic$fn__1056$_inc__1057.invoke(logic.clj:1160) at clojure.core.logic$fn__894$_inc__895.invoke(logic.clj:826) at clojure.core.logic$fn__1056$_inc__1057.invoke(logic.clj:1160) at clojure.core.logic$fn__898$_inc__899.invoke(logic.clj:823) at clojure.core.logic$fn__898$_inc__899.invoke(logic.clj:823) at clojure.core.logic$fn__898$_inc__899.invoke(logic.clj:823) at clojure.core.logic$fn__890$fn__891.invoke(logic.clj:828) Here's (glyph-) for reference (don't mind all the extra [], I have a weird key/value thing because of some conveniences for maintaining fact identity in a temporal database): (defna glyph- [Key Val] ([[Thing] [Glyph]] (thing- [Thing]) (on-fire_ *turn* [Thing]) (== Glyph \δ)) ([[Thing] [Glyph]] (thing- [Thing]) (fresh [Type] (type- [Thing] [Type]) (glyph- [Type] [Glyph]))) ([[(type-enum :player)] [Glyph]] (== Glyph \@)) ([[(type-enum :dragon)] [Glyph]] (== Glyph \D)) ([[Type] [Glyph]] (== Glyph \?))) and type-enum as a macro: (defmacro type-enum [v] `[:enum :type ~v]) and as a fn: (defn type-enum [v] [:enum :type ~v]) I'll mess around and see if my example works in HEAD. |
| Comment by Joe Osborn [ 19/Jul/12 5:37 PM ] |
|
Same exception with this test case in HEAD (sorry for all the facts): (defrel thing- [Thing]) (defrel type- [Thing] [Type]) (fact thing- [0]) (fact thing- [1]) (fact thing- [2]) (fact type- [0] [:player]) (fact type- [1] [:dragon]) (fact type- [2] [:pig]) (defn type-enum [t] [:type t]) (defna drawable- [Key] ([[Thing]] (thing- [Thing]) (fresh [Type] (type- [Thing] [Type]) (drawable- [Type]))) ([[(type-enum :player)]] succeed) ([[(type-enum :dragon)]] succeed)) (deftest do-fns-work (is (= (run* [q] (drawable- [q])) '(0 1)))) Now that I look at it, I may be expecting a wrong-format return value, but the point is that I don't even get that far. Using the REPL, I checked out how (defna drawable- . . .) expands (tidied up slightly): (def drawable- (clojure.core/fn ([Key] (clojure.core.logic/conda ((clojure.core.logic/fresh [Thing] (clojure.core.logic/== [Thing] Key) (thing- [Thing]) (fresh [Type] (type- [Thing] [Type]) (drawable- [Type])))) ((clojure.core.logic/fresh [type-enum] (clojure.core.logic/== [(type-enum :player)] Key) succeed)) ((clojure.core.logic/fresh [type-enum] (clojure.core.logic/== [(type-enum :dragon)] Key) succeed)))))) Note the (clojure.core.logic/fresh [type-enum] . . .) forms, which are exactly what I would not want to see in this case. I'm not really sure why this doesn't work here yet works for the matche test case. |
| Comment by David Nolen [ 19/Jul/12 5:47 PM ] |
[(type-enum :dragon)]
This pattern make it seem like you want to match: [[:type :dragon]] Note extra level of brackets here. Is this the case? Even so I agree that the expansion doesn't look quite right. We should never descend into a seq form like that. |
| Comment by Joe Osborn [ 19/Jul/12 5:57 PM ] |
|
Yes, that's exactly the desired outcome in this case--a tagged value in my naive interpretation. Is the reason it fails whereas the test on :1230 doesn't the fact that it's producing a vector and not a list? Changing the fn to return a list instead of a vector didn't seem to help. My patch, fwiw, doesn't exhibit that behavior (at least for macros, haven't tested it with fns). |
| Comment by David Nolen [ 19/Jul/12 9:11 PM ] |
|
What I mean is don't you want the following instead? (defna drawable- [Key] ([[Thing]] (thing- [Thing]) (fresh [Type] (type- [Thing] [Type]) (drawable- [Type]))) ([(type-enum :player)] succeed) ([(type-enum :dragon)] succeed)) Note that I removed a layer of square brackets. |
| Comment by Joe Osborn [ 20/Jul/12 10:28 AM ] |
|
Nope! I actually want both. I'm doing some temporal logic stuff and I wanted some conveniences for "updating" a fluent, so I wanted to distinguish between the "key part" and the "value part" of the arguments. It looks silly for facts with no "value part", but it lets me write procedures and fns something like this: (defrel heldo Time Fluent) (defrel ¬heldo Time Fluent) (declare fluent-obtainedo) ; most recent 'held' not terminated by a '¬held', or fail (defn alter-fluent [Time Rel Key NewVal] ;todo: error check, ensure old != new, old obtains, new does not obtain (doseq [old-val (run* [old-val] (fluent-obtainedo Time [Rel Key old-val]))] (fact ¬heldo Time [Rel Key old-val])) (fact heldo Time [Rel Key NewVal])) . . . (fact heldo 0 ['pos [0] [0 0]]) . . . (alter-fluent 1 'pos [0] [1 1]) And I write all the non-temporal fluents that way too for consistency and to help prevent mistakes. |
| Comment by David Nolen [ 20/Jul/12 2:58 PM ] |
|
I'll try to give a closer look at this issue over the weekend. |
| Comment by David Nolen [ 17/Mar/13 7:05 PM ] |
|
We're thinking about a more general solution here: http://github.com/clojure/core.logic/wiki/Better-syntax-support |
[CLJS-485] clojure.string/replace ignores regex flags Created: 12/Mar/13 Updated: 12/Mar/13 |
|
| Status: | Open |
| Project: | ClojureScript |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Defect | Priority: | Minor |
| Reporter: | Esa Virtanen | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | bug, patch, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
The replace function in namespace clojure.string ignores regex flag provided in the match pattern. For example: CLJS clojure.string/replace "I am NOT matched" #"(?i)not " "") => "I am NOT matched" CLJ clojure.string/replace "I am NOT matched" #"(?i)not " "") => "I am matched" The attached patch fixes this by parsing the m and i flags, if set, from the match object, instead of explicitly setting only "g". |
[CLJS-260] Add clojure.core/shuffle implementation Created: 17/May/12 Updated: 20/May/12 Resolved: 20/May/12 |
|
| Status: | Resolved |
| Project: | ClojureScript |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Evan Mezeske | Assignee: | Unassigned |
| Resolution: | Completed | Votes: | 0 |
| Labels: | enhancement, patch,, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
I added a simple implementation of clojure.core/shuffle, which uses goog.array's Fisher-Yates for its implementation. Included in the patch is a test to make sure it works. |
| Comments |
| Comment by David Nolen [ 17/May/12 7:07 PM ] |
|
Why don't you return a vector like Clojure does? |
| Comment by Evan Mezeske [ 17/May/12 7:11 PM ] |
|
Return a vector like Clojure. |
| Comment by David Nolen [ 18/May/12 9:23 PM ] |
|
The patch is not correctly formatted with attribution. |
| Comment by Evan Mezeske [ 20/May/12 4:24 PM ] |
|
Use git format-patch instead of git diff, to hopefully provide the right patch format. |
| Comment by David Nolen [ 20/May/12 10:28 PM ] |
|
fixed, http://github.com/clojure/clojurescript/commit/b06905863a9b0ce3618634d8fe0effb3aefd4063 |
[CLJ-1094] Zero-arity versions of every-pred and some-fn Created: 25/Oct/12 Updated: 25/Oct/12 |
|
| Status: | Open |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Tassilo Horn | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | patch, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
This patch adds zero-arity versions of every-pred and some-fn with these semantics. (every-pred) === (constantly true) (some-fn) === (constantly nil) These variants are useful in situations like the following: ;; compute-preds-for may return zero or many predicate fns (let [preds (compute-preds-for something)] (filter (apply every-pred preds) some-coll)) |
| Comments |
| Comment by Tassilo Horn [ 25/Oct/12 7:12 AM ] |
|
This is the thread where Max Penet suggested to have 0-arity versions of the two fns: https://groups.google.com/forum/?fromgroups=#!topic/clojure/IRlN-4LH_U0 |
[CLJ-990] Implement clojure.core.reducers/mapcat and some initial reducers tests Created: 10/May/12 Updated: 01/Mar/13 Resolved: 10/May/12 |
|
| Status: | Closed |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.5 |
| Fix Version/s: | Release 1.5 |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Tassilo Horn | Assignee: | Unassigned |
| Resolution: | Completed | Votes: | 0 |
| Labels: | patch, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
The first patch implements a reducers equivalent of clojure.core/mapcat, and the second patch adds a new reducers.clj to the clojure tests that checks that map, mapcat, filter, and reduce are equivalent in clojure.core and clojure.core.reducers. |
| Comments |
| Comment by Rich Hickey [ 10/May/12 7:44 PM ] |
|
applied - thanks! |
[CLJ-982] Implement an interface? predicate to balance class? Created: 04/May/12 Updated: 09/Jun/12 Resolved: 08/Jun/12 |
|
| Status: | Closed |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.5 |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Trivial |
| Reporter: | David Rupp | Assignee: | Unassigned |
| Resolution: | Declined | Votes: | 0 |
| Labels: | enhancement, patch, test | ||
| Environment: |
Any |
||
| Attachments: |
|
| Patch: | Code and Test |
| Description |
|
clojure.core implements a class? predicate to detect if a thing is an instance of java.lang.Class. The attached patch implements interface? to further distinguish classes that are also interfaces. This gives us Clojure api for e.g., enumerating all interfaces a thing's base class implements; as in, (filter #(interface? %) (supers (class my-thing))). |
| Comments |
| Comment by Stuart Halloway [ 08/Jun/12 12:28 PM ] |
|
I would prefer to see this, and other interop/reflective items, in a separate contrib lib. |
| Comment by David Rupp [ 09/Jun/12 9:08 AM ] |
|
Thanks for the feedback, Stu. Is there an existing contrib lib for stuff like this? Or should I create one? |
[CLJ-964] test-clojure/rt.clj has undeclared dependency on clojure.set Created: 31/Mar/12 Updated: 18/Aug/12 Resolved: 18/Aug/12 |
|
| Status: | Closed |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | Release 1.3, Release 1.4 |
| Fix Version/s: | Release 1.5 |
| Type: | Defect | Priority: | Trivial |
| Reporter: | David Miller | Assignee: | Unassigned |
| Resolution: | Completed | Votes: | 0 |
| Labels: | test | ||
| Attachments: |
|
| Patch: | Code |
| Approval: | Ok |
| Description |
|
In test-clojure/rt.clj, the test last-var-wins-for-core evaluates #'clojure.set/subset?. This fails unless clojure.set has been loaded. In the normal run of the test suite, this dependency is satisfied by test-clojure/core-set being loaded first. |
| Comments |
| Comment by Andy Fingerhut [ 31/Mar/12 8:47 PM ] |
|
clj-964-add-require-of-clojure-set-patch1.txt dated March 31, 2012 applies cleanly as of latest master. It simply adds a require of clojure.set to test_clojure/rt.clj. I verified that if that test was the only one, it does fail without the require, and passes with it. I also verified that every other test file succeeds on its own without any further changes. |
| Comment by Aaron Bedra [ 14/Aug/12 8:30 PM ] |
|
Patch applies cleanly against 4004d267e124f12b65b0d7fb6522f32a75e3c4fb. Submitter is a confirmed CA signer. |
[CLJ-879] Allow :require to support a :refer clause Created: 17/Nov/11 Updated: 17/Feb/12 Resolved: 17/Feb/12 |
|
| Status: | Closed |
| Project: | Clojure |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Enhancement | Priority: | Minor |
| Reporter: | Phil Hagelberg | Assignee: | Phil Hagelberg |
| Resolution: | Completed | Votes: | 9 |
| Labels: | patch,, test | ||
| Attachments: |
|
| Patch: | Code and Test |
| Approval: | Ok |
| Description |
|
There's been discussion previously about the complexity of the ns We can't change the fact that :use refers everything by default Clojure-dev thread discussing this: http://groups.google.com/group/clojure-dev/browse_thread/thread/91b708ddb909affd |
| Comments |
| Comment by Phil Hagelberg [ 25/Nov/11 2:52 PM ] |
|
Patch containing implementation, test, and documentation. |
| Comment by Phil Hagelberg [ 06/Jan/12 2:21 PM ] |
|
Any chance we could get some discussion going on this? |
| Comment by Devin Torres [ 14/Jan/12 1:12 AM ] |
|
I'd love to see this discussed. |
| Comment by Phil Hagelberg [ 27/Jan/12 4:42 PM ] |
|
So... how about it? Thoughts? |
| Comment by Kevin Downey [ 17/Feb/12 11:30 AM ] |
|
patch still applies cleanly to master, tests pass there is a warning when you run the tests though: [java] Testing clojure.test-clojure.keywords |
| Comment by Stuart Sierra [ 17/Feb/12 1:36 PM ] |
|
Vetted. Patch is good, although it needs docstring updates in 'require' |
| Comment by Stuart Sierra [ 17/Feb/12 1:55 PM ] |
|
Not Vetted. I can't remember what the names mean. Ready for Rich. That's "Test" right? |
| Comment by Stuart Sierra [ 17/Feb/12 1:59 PM ] |
|
My mistake. The docstring is included in 'require', but not in 'refer', which also changed. But the public API of 'refer' did not change. So this patch is good. |
| Comment by Stuart Sierra [ 17/Feb/12 2:08 PM ] |
|
Not "Test." Screened. The patch is Screened. I hate this. |
| Comment by Stuart Sierra [ 17/Feb/12 2:18 PM ] |
|
Patch applied. |