saeta / penguin Goto Github PK
View Code? Open in Web Editor NEWA suite of libraries for data science & high performance computation in Swift
License: Apache License 2.0
A suite of libraries for data science & high performance computation in Swift
License: Apache License 2.0
Even if you need to check it in somewhere else, just trying to quick-open a swift file, or do a global search, often leaves me in an .html file I don't care about. Slows development down a lot!
These things can be generated using GH actions if for some reason a stock jekyll or HTML site is insufficient.
By cannibalizing implementation details of Dictionary from the standard library (which should be exposed as part of a hashtable construction kit, but that's a separate issue) we could avoid storing a dictionary plus an array, and (I think) avoid storing keys twice.
Test Case 'ArrayStorageTests.test_appending' started at 2020-06-07 06:34:38.900
/home/runner/work/penguin/penguin/Tests/PenguinStructuresTests/ArrayStorageTests.swift:104: error: ArrayStorageTests.test_appending : XCTAssertEqual failed: ("40") is not equal to ("24") -
Context: https://github.com/saeta/penguin/pull/66/checks?check_run_id=746602209
(Rerunning it once seemed to make everything pass just fine.)
Though it's a pain to do with XCTest, it can be done, and should be encapsulated into a sub-library:
https://medium.com/@marcosantadev/how-to-test-fatalerror-in-swift-e1be9ff11a29
https://stackoverflow.com/questions/32873212/unit-test-fatalerror-in-swift
So that these tests can be re-used in dependent packages.
Hi,
I'm watching this package with interest.
At some point it would be cool to do some testing against the benchmarks in this blogpost, both to guide dev and to be featured in the next round: https://www.timlrx.com/2020/05/10/benchmark-of-popular-graph-network-packages-v2/
$ which swift
/home/xander/swift-tensorflow-DEVELOPMENT-cuda10.2-cudnn7-stock-ubuntu18.04/usr/bin/swift
$ swift --version
Swift version 5.3-dev (LLVM a80ce7032652e19, Swift 6a6f972f7fcf51d)
Target: x86_64-unknown-linux-gnu
$ git log
commit fca2fc0e0581656449f1cee40ec5513f7a957446 (HEAD -> main, origin/main, origin/HEAD)
Author: Dave Abrahams <[email protected]>
Date: Mon Dec 21 13:39:50 2020 -0800
Make base of Projections public. (#138)
[4/4] Compiling PenguinTables TypedColumn.swift
$ swift package clean
$ swift build
createBuildSystem false
/home/xander/dev/penguin/Sources/PenguinParallel/ConcurrencyPlatform.swift:105:5: warning: future versions of Swift reserve the word 'await'; if this name is unavoidable, use backticks to escape it
await(predicate)
^~~~~
`await`
/home/xander/dev/penguin/Sources/PenguinParallel/ConcurrencyPlatform.swift:105:5: warning: future versions of Swift reserve the word 'await'; if this name is unavoidable, use backticks to escape it
await(predicate)
^~~~~
`await`
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:20:33: error: cannot find type 'KeyPathIterable' in scope
public protocol PTableSchema: KeyPathIterable, PDefaultInit {
^~~~~~~~~~~~~~~
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:26:27: error: value of type 'Self' has no member 'allKeyPaths'
let keyPaths = self.allKeyPaths as! [PartialKeyPath<Self>]
~~~~ ^~~~~~~~~~~
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:20:33: error: cannot find type 'KeyPathIterable' in scope
public protocol PTableSchema: KeyPathIterable, PDefaultInit {
^~~~~~~~~~~~~~~
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:26:27: error: value of type 'Self' has no member 'allKeyPaths'
let keyPaths = self.allKeyPaths as! [PartialKeyPath<Self>]
~~~~ ^~~~~~~~~~~
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:20:33: error: cannot find type 'KeyPathIterable' in scope
public protocol PTableSchema: KeyPathIterable, PDefaultInit {
^~~~~~~~~~~~~~~
/home/xander/dev/penguin/Sources/PenguinTables/TableSchema.swift:20:33: error: cannot find type 'KeyPathIterable' in scope
public protocol PTableSchema: KeyPathIterable, PDefaultInit {
^~~~~~~~~~~~~~~
I just tried this using the latest nightly as of 29 January 2021 and got the same result.
Point users to vertices.count
and edges.count
instead, and add to documentation VertexListGraph
and EdgeListGraph
that conforming graphs should ensure the count
properties of vertices
and edges
are as efficient as possible.
InsertionOrderedDictionary
has most of the same APIs as Dictionary
and there are some common algorithms we can build upon that (currently in PenguinExtensions.swift). It's unclear how much is specific to a hashed dictionary and whether a SortOrderedDictionary
would have a subset of these APIs. Investigating that is another interesting project.
This is by no means urgent, but is a clearly missing piece.
As I have been working on InsertionOrderedDictionary
, I've started to wonder whether NominalElementDictionary
was such a hot idea. Instead, maybe the thing to do is make an extension on Dictionary
called nominalElements
that presents the (key: Key, value: Value)
elements as a Collection
of KeyValuePair<Key, Value>
. When people need the capabilities associated with a collection of KeyValuePair
, they can use this extension. Otherwise it just sits there.
Part of the reason for this is that you lose convenient destructuring that was available with tuples. Part is the massive complexity overhead of making the whole dictionary API just in order to be able to use Collection where Element: SomeProtocol
extensions.
It's super easy to build what you assume to be a correct model of a protocol and have it function perfectly well in tests of other components but also be utterly broken. You need to test the semantics of all the protocol requirements, and doing that for a commonly-modeled protocol like Collection
is tedious and error-prone. We need a set of testing components for common protocols akin to what's in https://github.com/apple/swift/tree/master/stdlib/private/StdlibCollectionUnittest but based on XCTest.
(Please feel free to disregard if it's out of scope for this library, or send me to an existing implementation if available.)
My app has a bunch of cases where many arrays are created. Most of these arrays are expected to be fairly short (<= 3 elements), but the length of the longest arrays is potentially unbounded.
It would be great to have a data structure that could automatically store the first few elements inline to avoid allocating the array buffer altogether. For example, up to 7 Int8
s could be stored in the 8 bytes occupied by Array<Int8>
before an allocation would be necessary. With some bit fiddling, it might even be possible to store a single pointer in a regular array's 8 bytes. I am not an expert on that, however; not sure how many bits are "left" for such purposes. For arrays larger than that, the implementation could "fall through" to a regular buffer-backed array.
I would also happily give up some stack space in exchange for saving these allocations. If I could store up to 3 pointers in a 24-byte data structure with the possibility of automatically expanding to the heap when those 3 slots are exceeded, I would be very happy. Given that ArrayBuffer
already takes some heap space of its own (not sure how much off the top of my head, but definitely >= 8), I would "lose" at most 8 bytes in the "up to 3 case", potentially zero if ArrayBuffer
takes >= 16 bytes on the heap.
Given that this library already implements ArrayN
, I was wondering whether such use cases would be in scope for this.
For example, on the 2020-11-18 toolchain, swift build -c release
gives:
[1/5] Compiling PenguinTesting StdlibProtocolTests.swift
swift-frontend: /home/build-user/swift/lib/SIL/Utils/MemAccessUtils.cpp:98: void (anonymous namespace)::AccessPhiVisitor<(anonymous namespace)::FindAccessBaseVisitor>::checkVisitorResult(swift::SILValue) [UseDefVisitor = (anonymous namespace)::FindAccessBaseVisitor]: Assertion `!result && "must override any visitor that returns a result"' failed.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0. Program arguments: /usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend -frontend -c /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/AnyArrayBuffer.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/AnyValue.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/ArrayBuffer.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/ArrayStorage.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/CollectionAlgorithms.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Concatenation.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/DefaultInitializable.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Deque.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Either.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Empty.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/FactoryInitializable.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/FixedSizeArray.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Heap.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/HierarchicalArrays.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/HierarchicalCollection.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/IdIndexable.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/InsertionOrderedDictionary.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/KeyValuePair.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Lens.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/NominalElementDictionary.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/PCGRandomNumberGenerator.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Projections.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Random.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/SourceInitializableCollection.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Tuple.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/Type.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/TypeID.swift /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/UnsignedInteger+Reduced.swift -supplementary-output-file-map /tmp/supplementaryOutputs-9c95c9 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release -g -module-cache-path /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -parse-as-library -module-name PenguinStructures -num-threads 12 -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/AnyArrayBuffer.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/AnyValue.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/ArrayBuffer.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/ArrayStorage.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/CollectionAlgorithms.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Concatenation.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/DefaultInitializable.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Deque.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Either.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Empty.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/FactoryInitializable.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/FixedSizeArray.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Heap.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/HierarchicalArrays.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/HierarchicalCollection.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/IdIndexable.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/InsertionOrderedDictionary.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/KeyValuePair.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Lens.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/NominalElementDictionary.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/PCGRandomNumberGenerator.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Projections.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Random.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/SourceInitializableCollection.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Tuple.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/Type.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/TypeID.swift.o -o /usr/local/google/home/marcrasi/git/penguin/.build/x86_64-unknown-linux-gnu/release/PenguinStructures.build/UnsignedInteger+Reduced.swift.o
1. Swift version 5.3-dev (LLVM d6fb8423828a5e4, Swift 54144acf6a727e9)
2. While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, Serialize, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for PenguinStructures.PenguinStructures)
3. While running pass #25667 SILFunctionTransform "EarlyRedundantLoadElimination" on SILFunction "@$s17PenguinStructures8AnyValueV10storedTypeypXpvg".
for getter for storedType (at /usr/local/google/home/marcrasi/git/penguin/Sources/PenguinStructures/AnyValue.swift:73:14)
#0 0x00000000054b68d4 PrintStackTraceSignalHandler(void*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x54b68d4)
#1 0x00000000054b44ce llvm::sys::RunSignalHandlers() (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x54b44ce)
#2 0x00000000054b6ab5 SignalHandler(int) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x54b6ab5)
#3 0x00007f6856d45140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
#4 0x00007f6856831db1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f685681b537 abort ./stdlib/abort.c:81:7
#6 0x00007f685681b40f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
#7 0x00007f685681b40f _nl_load_domain ./intl/loadmsgcat.c:970:34
#8 0x00007f685682a5b2 (/lib/x86_64-linux-gnu/libc.so.6+0x345b2)
#9 0x000000000120431a (anonymous namespace)::AccessPhiVisitor<(anonymous namespace)::FindAccessBaseVisitor>::findPhiAccess(swift::SILPhiArgument*) && (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x120431a)
#10 0x0000000001203bd5 swift::AccessUseDefChainVisitor<(anonymous namespace)::FindAccessBaseVisitor, swift::SILValue>::visit(swift::SILValue) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x1203bd5)
#11 0x0000000001203763 (anonymous namespace)::FindAccessVisitorImpl<(anonymous namespace)::FindAccessBaseVisitor>::reenterUseDef(swift::SILValue) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x1203763)
#12 0x00000000011fff9e swift::isLetAddress(swift::SILValue) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x11fff9e)
#13 0x0000000000d70da9 swift::SILInstructionVisitor<(anonymous namespace)::MemoryBehaviorVisitor, swift::SILInstruction::MemoryBehavior>::visit(swift::SILInstruction*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xd70da9)
#14 0x0000000000d70c7b swift::AliasAnalysis::computeMemoryBehaviorInner(swift::SILInstruction*, swift::SILValue) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xd70c7b)
#15 0x0000000000d70972 swift::AliasAnalysis::computeMemoryBehavior(swift::SILInstruction*, swift::SILValue) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xd70972)
#16 0x0000000000bad9bb (anonymous namespace)::BlockState::processUnknownWriteInst((anonymous namespace)::RLEContext&, swift::SILInstruction*, RLEKind) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xbad9bb)
#17 0x0000000000ba4625 (anonymous namespace)::RedundantLoadElimination::run() (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xba4625)
#18 0x0000000000aaf492 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xaaf492)
#19 0x0000000000ab03a7 swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xab03a7)
#20 0x0000000000aad8a8 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xaad8a8)
#21 0x0000000000aad85b swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xaad85b)
#22 0x0000000000acde3a swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xacde3a)
#23 0x0000000000ab8351 llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xab8351)
#24 0x0000000000aada85 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xaada85)
#25 0x0000000000abaa3f swift::runSILOptimizationPasses(swift::SILModule&) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0xabaa3f)
#26 0x0000000000690662 swift::CompilerInstance::performSILProcessing(swift::SILModule*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x690662)
#27 0x0000000000514261 performCompileStepsPostSILGen(swift::CompilerInstance&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x514261)
#28 0x0000000000513c97 performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x513c97)
#29 0x00000000005084fe swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x5084fe)
#30 0x000000000049a7d1 main (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x49a7d1)
#31 0x00007f685681ccca __libc_start_main ./csu/../csu/libc-start.c:308:16
#32 0x000000000049a37e _start (/usr/local/google/home/marcrasi/Downloads/swift-toolchains/master-2020-11-18/swift-DEVELOPMENT-SNAPSHOT-2020-11-18-a-ubuntu20.04/usr/bin/swift-frontend+0x49a37e)
This also affects the tensorflow 0.12 toolchain.
I have figured out a workaround that I will upload a PR for soon.
Swift will then use the set
accessor for direct assignments and only use the _modify
accessor for other mutations, which could be a performance win.
Context: #32 (Deferred until after performance issues from #33 are resolved.)
CC @dabrahams
We shouldn't be using classes to dispatch AnyArrayBuffer
anymore. Those other facilities create one vtable per type per thread. Probably there's a once-init strategy that eliminates the per-thread thing.
Potential names to re-think:
VertexId
/ EdgeId
/ Edge
/ Vertex
and associated documentation.source(_:)
/ destination(_:)
VertexListGraph
/ EdgeListGraph
Partial context: https://github.com/saeta/penguin/pull/84/files#r440518969, https://github.com/saeta/penguin/pull/84/files#r440526601
https://github.com/saeta/penguin/blob/master/Tests/PenguinStructuresTests/AnyArrayBufferTests.swift is pitiful and should be fleshed out
When updating the existing key
with updateValue
method the original index
is not set back after acquiring it with indexForKey.updateValue(endIndex, forKey: key)
.
I believe this should be done after the guard
statement:
guard let index = indexForKey.updateValue(endIndex, forKey: key) else {
elements.append(.init(key: key, value: newValue))
return nil
}
indexForKey[key] = index
At the moment of writing InsertionOrderedDictionaryTests
don't have tests for updateValue
.
The following test triggers the assertion:
func test_updateValue() {
var d0 = p0
for (key, value) in p1 {
XCTAssertEqual(d0[key], value)
let replaced = d0.updateValue("*", forKey: key)
XCTAssertEqual(d0[key], "*")
XCTAssertEqual(replaced, value)
}
XCTAssertEqual(d0[99], nil)
}
Unsafe[Mutable]BufferPointer
s currently permit the baseAddress
to be nil
, which is both an inconvenience & a potential performance problem.
Context: #62 (comment)
CC @dabrahams
The effect is to slow down development. Is this something under our control?
Creating a tracking issue to group related PRs.
Priorly a warning (as seen in #142) but now hard fail, in ConditionMutexProtocol
.
When I'm using TLS, it's for performance reasons. I don't want to worry about whether I'm getting ARC. Let me allocate a struct in dynamic memory and store a pointer to it in my TLS, please. Thanx!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.