Repository navigation
Implementing the Virtual File System as long with the OS File System - #175
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
Description
Implements the two-tier OS filesystem and Virtual File System (VFS) in
gp::core, migratesFileSinkoffstd::FILE, and wires VFS lifecycle management intogp::Application.Layer 0: OS FileSystem and FileHandle (
gp::platform)gp::platform::FileHandle(source/runtime/core/public/platforms/base/system/FileHandle.hpp) as an 8-byte non-polymorphic RAII wrapper around native OS file descriptors (HANDLEon Windows,intfd on POSIX), supporting sequential I/O (read,write,seek,tell,size,flush,truncate) and lock-free positional I/O (readAt,writeAtvia Win32OVERLAPPEDoffsets and POSIXpread/pwrite).gp::platform::FileSystemacross Windows, Unix, Linux, Apple, macOS, and generic backends (source/runtime/core/public/platforms/*/system/), covering file/directory queries, tree creation and removal, moves, copies, zero-allocation stack-buffered directory iteration (iterateDirectory,iterateDirectoryRecursive), bulk read/write helpers, and crash-safe atomic writes (writeAtomicusing<path>.tmp.<seq>,CreateNew,flush(), and atomic rename).Layer 1: Priority-Layered VFS (
gp::vfs)gp::vfs::VirtualFileSystem(source/runtime/core/public/vfs/VirtualFileSystem.hpp) backed by a zero-allocation.bssmount table (kMaxMountPoints = 32) guarded bySharedMutex.IMountBackendwithPhysicalMountBackendandMemoryMountBackend, priority overlay resolution (DeveloperOverride > ModOverride > Patch > DLC > Base), single-targetReadWriterouting, cross-mount streamingcopyFile, sandbox escape rejection (VfsError::SandboxEscapeViolation), and deduplicated merged directory iteration.enumerateMounts()and sixAutoConsoleCommanddiagnostics inVirtualFileSystem.cpp:vfs.Status,vfs.Mounts,vfs.Resolve,vfs.Exists,vfs.Stat, andvfs.Ls.Application, Editor, and FileSink Integration
std::FILEand<cstdio>ingp::log::FileSinkwithgp::platform::FileHandle, creating missing parent directories on open and sharing read access (FileShareMode::Read) so logs can be read while open.VirtualFileSystem::initializeDefaultMounts()andVirtualFileSystem::shutdown()intogp::Application(ApplicationDesc,Application.hpp,Application.cpp) with-no-vfsand-vfs-app=<name>CLI overrides, preserving pre-mounted caller backends and resolving VFS URIs passed to-log-file.TODO(vfs)marker inEditorApplication::onInitialize()(source/launch/editor/private/Main.cpp) for futureeditor://mounts.Documentation and Tests
docs/adr/ADR-0060.md(Accepted), updateddocs/adr/ADR-0044.mdtoAccepted, and registered ADR-0060 indocs/adr/INDEX.md.FileSystem.tests.cpp,VirtualFileSystem.tests.cpp,Logger.tests.cpp, andApplication.tests.cpp.clang-format --dry-run --Werror, a fullwindows-developmentbuild (0warnings),gp-core-tests.exe(1,437passed), andgp-application-tests.exe(13passed).Checklist
gp-engineC++ Coding Standard.GP Contributor License Agreement
I give to the Graphical Playground Team, LLC permission to license my contributions on any terms
they like. I am giving them this license in order to make it possible for them to accept my
contributions into their project.