Great to hear from you Artem!
- Is this project related to this?
Not directly. That one is a general mechanism for fuzzing the APIs of a program written in Swift, while this is about creating and using a tool written in Swift to fuzz and stress test the Swift compiler (and SourceKit) itself.
While you could use libFuzzer to fuzz the Swift compiler and SourceKit, its mutations aren't syntax aware, so the resulting input often doesn't progress past lexing/parsing when compiled due to syntactic errors. This means the type checker and lower levels of the compiler wouldn't be exercised very often. The aim of this project is to use Swift's libSyntax, which lets us easily perform structured mutations on an existing Swift file, to generate inputs that are well-formed enough to progress beyond lexing/parsing in most cases and find issues in the later phases of compilation.
Kostya Serebryany gave a talk at last year's LLVM dev meeting about overcoming this issue when fuzzing the Clang compiler.
- Which fuzzers do developers of Swift language use at the present time?
I'm not sure, sorry! Some contributors do seem to be using them, but I'm not sure what specific tools they're using.
- Is there any starter task for this project? What should I do now to become more familiar with the problem?
Are you familiar with C++ at all? If so, libSyntax isn't actually complete yet, so your help there would be appreciated! See here for how to implement missing syntax nodes, and here for contributing to Swift in general.
In terms of familiarization, the mutated inputs will need to be fed to the Swift compiler and SourceKit, so see if you can do so. For the compiler, this will likely just be launching an external process from Swift and detecting whether it crashes. For SourceKit you can try our work-in-progress wrapper around the SourceKit service, SwiftLang. Instructions are the same as for libSyntax here except you need to add $(TOOLCHAIN_DIR)/usr/lib to your framework and runpath search paths and import SwiftLang at the top of your file. Here's some example usage to make a code completion request get started:
let connection = SourceKitdService()
let request = SourceKitdRequest(uid: SourceKitdUID.request_CodeComplete)
request.addParameter(.key_SourceText, value: """
struct Foo {
let x = 12
}
Foo().
""")
request.addParameter(.key_Name, value: "something_unique")
request.addParameter(.key_Offset, value: 34)
let compilerArgs = request.addArrayParameter(.key_CompilerArgs)
for arg in ["<input>"] { compilerArgs.add(arg) }
let response = connection.sendSyn(request: request)
print(response.description)
You can also use .key_SourceFile and supply a path to read the input from disk. SourceKit's API isn't particularly well documented as far as I'm aware, so the best reference is probably the implementation and tests, or just ask here 